1
0
mirror of https://github.com/metabolist/metatext synced 2024-12-11 08:55:54 +01:00
metatext-app-ios-iphone-ipad/Views/RootView.swift
2020-09-01 00:33:49 -07:00

32 lines
803 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 tabNavigationViewModel = viewModel.tabNavigationViewModel {
TabNavigationView(viewModel: tabNavigationViewModel)
.id(UUID())
.environmentObject(viewModel)
.transition(.opacity)
} else {
AddIdentityView(viewModel: viewModel.addIdentityViewModel())
.environmentObject(viewModel)
.transition(.opacity)
}
}
}
#if DEBUG
import PreviewViewModels
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
RootView(viewModel: .mock())
}
}
#endif