mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Move sheet modifier outside of NavigationView
This commit is contained in:
parent
322e9e9af5
commit
6ea10fb434
@ -13,6 +13,18 @@ struct ContentView: View {
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.environmentObject(model)
|
||||
|
||||
#if os(iOS)
|
||||
EmptyView()
|
||||
.sheet(
|
||||
isPresented: $model.isPresentingSettingsView,
|
||||
onDismiss: { model.isPresentingSettingsView = false },
|
||||
content: {
|
||||
SettingsView()
|
||||
.environmentObject(model)
|
||||
}
|
||||
)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,6 @@ struct PostListView: View {
|
||||
@State var selectedCollection: WFACollection?
|
||||
@State var showAllPosts: Bool = false
|
||||
|
||||
#if os(iOS)
|
||||
@State private var isPresentingSettings = false
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
#if os(iOS)
|
||||
GeometryReader { geometry in
|
||||
@ -31,18 +27,10 @@ struct PostListView: View {
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
HStack {
|
||||
Button(action: {
|
||||
isPresentingSettings = true
|
||||
model.isPresentingSettingsView = true
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
}).sheet(
|
||||
isPresented: $isPresentingSettings,
|
||||
onDismiss: {
|
||||
isPresentingSettings = false
|
||||
},
|
||||
content: {
|
||||
SettingsView(isPresented: $isPresentingSettings)
|
||||
}
|
||||
)
|
||||
})
|
||||
.padding(.leading)
|
||||
Spacer()
|
||||
Text(pluralizedPostCount(for: showPosts(for: selectedCollection)))
|
||||
|
Loading…
Reference in New Issue
Block a user