mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-22 21:46:28 +00:00
28 lines
764 B
Swift
28 lines
764 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import SwiftUI
|
|
|
|
struct RootView: View {
|
|
@StateObject var viewModel: RootViewModel
|
|
|
|
var body: some View {
|
|
if let tabNavigationViewModel = viewModel.tabNavigationViewModel {
|
|
TabNavigationView(viewModel: tabNavigationViewModel)
|
|
.id(UUID())
|
|
.environmentObject(viewModel)
|
|
.transition(.opacity)
|
|
} else {
|
|
AddIdentityView(viewModel: viewModel.addIdentityViewModel())
|
|
.environmentObject(viewModel)
|
|
.transition(.opacity)
|
|
}
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
RootView(viewModel: .development)
|
|
}
|
|
}
|
|
#endif
|