Files
swift-composable-architectu…/Examples/TicTacToe/tic-tac-toe/Sources/AppSwiftUI/AppView.swift
Stephen Celis 87f388bedb Further Modernize Demos (#914)
* Modernize Demos

* wip
2021-12-09 22:41:58 -05:00

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)
}
}
}
}