Files
AlloVoisinsSwiftUI/AlloVoisinsSwiftUI/Features/Booster/Views/Components/BoosterSelectionView.swift
Victor Bodinaud 6e711be25d 🏗️ Reorganize files
2024-11-14 10:07:56 +01:00

43 lines
1.2 KiB
Swift

//
// BoosterSelectionView.swift
//
//
// Created by Victor on 12/06/2024.
//
import SwiftUI
struct BoosterSelectionView: View {
@State var selectedId: Int = 1
var isAppleSubscription: Bool = false
var oneMonthFree: Bool = true
var body: some View {
VStack(spacing: 16) {
HStack(alignment: .top, spacing: 0) {
if isAppleSubscription {
BoosterSubscriptionCardView(id: 1, selectedId: .constant(1))
} else {
ForEach(0...2, id: \.self) { index in
BoosterSubscriptionCardView(id: index, selectedId: $selectedId, isFree: index == 1)
.onTapGesture {
selectedId = index
}
}
}
}
SQText("* 1 mois gratuit valable uniquement sur la formule “3 jours par semaine.”", size: 14)
.multilineTextAlignment(.center)
.foregroundColor(.sqRoyal())
}
}
}
#Preview {
ZStack {
BoosterSelectionView(oneMonthFree: true)
.padding()
}
.ignoresSafeArea()
}