Drive `HomeView` Navigation state from `ViewStore`

This demonstrates going from a view with no active navigation, to one that is state driven.

It is intended to be representative of the work needed to achieve this.
This commit is contained in:
Daniel Haight 2021-11-10 20:20:28 +00:00
parent e458a491c4
commit 1adf39b933
1 changed files with 13 additions and 0 deletions

View File

@ -36,6 +36,19 @@ struct HomeView: View {
}
.padding(.horizontal, 30)
.navigationBarTitle("Home", displayMode: .inline)
.fullScreenCover(
isPresented: viewStore.showHistoryBinding,
content: {
NavigationView {
TransactionHistoryView(store: store.historyStore())
.toolbar {
ToolbarItem {
Button("Done") { viewStore.send(.updateRoute(nil)) }
}
}
}
}
)
}
}
}