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:
parent
e458a491c4
commit
1adf39b933
|
@ -36,6 +36,19 @@ struct HomeView: View {
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 30)
|
.padding(.horizontal, 30)
|
||||||
.navigationBarTitle("Home", displayMode: .inline)
|
.navigationBarTitle("Home", displayMode: .inline)
|
||||||
|
.fullScreenCover(
|
||||||
|
isPresented: viewStore.showHistoryBinding,
|
||||||
|
content: {
|
||||||
|
NavigationView {
|
||||||
|
TransactionHistoryView(store: store.historyStore())
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem {
|
||||||
|
Button("Done") { viewStore.send(.updateRoute(nil)) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue