vds_ios/VDS/Components/Carousel/CarouselPaginationModel.swift

41 lines
1.2 KiB
Swift

//
// CarouselPaginationModel.swift
// VDS
//
// Created by Kanamarlapudi, Vasavi on 06/06/24.
//
import Foundation
import UIKit
/// Custom data type for pagination prop for 'Carousel' component.
extension Carousel {
public struct CarouselPaginationModel {
/// Previous button to show previous slide.
public var previousButton = ButtonIcon().with {
$0.kind = .lowContrast
$0.iconName = .leftCaret
$0.iconOffset = .init(x: -2, y: 0)
$0.icon.size = UIDevice.isIPad ? .small : .xsmall
$0.size = UIDevice.isIPad ? .large : .small
}
/// Next button to show next slide.
public var nextButton = ButtonIcon().with {
$0.kind = .lowContrast
$0.iconName = .rightCaret
$0.iconOffset = .init(x: 2, y: 0)
$0.icon.size = UIDevice.isIPad ? .small : .xsmall
$0.size = UIDevice.isIPad ? .large : .small
}
public init(kind: ButtonIcon.Kind, floating: Bool) {
previousButton.kind = kind
nextButton.kind = kind
previousButton.floating = floating
nextButton.floating = floating
}
}
}