mirror of
https://github.com/metabolist/metatext
synced 2024-12-20 22:33:54 +01:00
35 lines
912 B
Swift
35 lines
912 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import SwiftUI
|
|
import ViewModels
|
|
|
|
struct RootView: View {
|
|
@StateObject var viewModel: RootViewModel
|
|
|
|
var body: some View {
|
|
if let identification = viewModel.identification {
|
|
TabNavigationView()
|
|
.id(UUID())
|
|
.environmentObject(identification)
|
|
.environmentObject(TabNavigationViewModel(identification: identification))
|
|
.environmentObject(viewModel)
|
|
.transition(.opacity)
|
|
} else {
|
|
AddIdentityView(viewModel: viewModel.addIdentityViewModel())
|
|
.environmentObject(viewModel)
|
|
.transition(.opacity)
|
|
}
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
import Combine
|
|
import PreviewViewModels
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
RootView(viewModel: .preview)
|
|
}
|
|
}
|
|
#endif
|