mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
31 lines
708 B
Swift
31 lines
708 B
Swift
import AppCore
|
|
import ComposableArchitecture
|
|
import LoginSwiftUI
|
|
import NewGameSwiftUI
|
|
import SwiftUI
|
|
|
|
public struct AppView: View {
|
|
let store: Store<AppState, AppAction>
|
|
|
|
public init(store: Store<AppState, AppAction>) {
|
|
self.store = store
|
|
}
|
|
|
|
public var body: some View {
|
|
SwitchStore(self.store) {
|
|
CaseLet(state: /AppState.login, action: AppAction.login) { store in
|
|
NavigationView {
|
|
LoginView(store: store)
|
|
}
|
|
.navigationViewStyle(.stack)
|
|
}
|
|
CaseLet(state: /AppState.newGame, action: AppAction.newGame) { store in
|
|
NavigationView {
|
|
NewGameView(store: store)
|
|
}
|
|
.navigationViewStyle(.stack)
|
|
}
|
|
}
|
|
}
|
|
}
|