2022-05-09 09:52:09 +01:00
|
|
|
//
|
|
|
|
// OnboardingStepsView.swift
|
|
|
|
// SimpleX (iOS)
|
|
|
|
//
|
|
|
|
// Created by Evgeny on 07/05/2022.
|
|
|
|
// Copyright © 2022 SimpleX Chat. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct OnboardingView: View {
|
|
|
|
var onboarding: OnboardingStage
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
switch onboarding {
|
|
|
|
case .step1_SimpleXInfo: SimpleXInfo(onboarding: true)
|
2023-10-04 17:45:39 +01:00
|
|
|
case .step2_CreateProfile: CreateFirstProfile()
|
2023-05-01 20:36:52 +04:00
|
|
|
case .step3_CreateSimpleXAddress: CreateSimpleXAddress()
|
2024-11-19 15:37:00 +04:00
|
|
|
case .step3_ChooseServerOperators: ChooseServerOperators(onboarding: true)
|
2023-05-01 20:36:52 +04:00
|
|
|
case .step4_SetNotificationsMode: SetNotificationsMode()
|
2022-05-09 09:52:09 +01:00
|
|
|
case .onboardingComplete: EmptyView()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-05 12:56:48 +04:00
|
|
|
enum OnboardingStage: String, Identifiable {
|
2022-05-09 09:52:09 +01:00
|
|
|
case step1_SimpleXInfo
|
2024-11-19 15:37:00 +04:00
|
|
|
case step2_CreateProfile // deprecated
|
|
|
|
case step3_CreateSimpleXAddress // deprecated
|
|
|
|
case step3_ChooseServerOperators
|
2023-05-01 20:36:52 +04:00
|
|
|
case step4_SetNotificationsMode
|
2022-05-09 09:52:09 +01:00
|
|
|
case onboardingComplete
|
2023-05-05 12:56:48 +04:00
|
|
|
|
|
|
|
public var id: Self { self }
|
2022-05-09 09:52:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
struct OnboardingStepsView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
OnboardingView(onboarding: .step1_SimpleXInfo)
|
|
|
|
}
|
|
|
|
}
|