mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Move Settings button to PostList
This commit is contained in:
parent
94322a0424
commit
275dd91e9c
@ -4,27 +4,7 @@ struct SidebarView: View {
|
||||
@State var isPresentingSettings = false
|
||||
|
||||
var body: some View {
|
||||
#if os(iOS)
|
||||
VStack {
|
||||
CollectionListView()
|
||||
Spacer()
|
||||
Button(action: {
|
||||
isPresentingSettings = true
|
||||
}, label: {
|
||||
Text("Settings")
|
||||
}).sheet(
|
||||
isPresented: $isPresentingSettings,
|
||||
onDismiss: {
|
||||
isPresentingSettings = false
|
||||
},
|
||||
content: {
|
||||
SettingsView(isPresented: $isPresentingSettings)
|
||||
}
|
||||
)
|
||||
}
|
||||
#else
|
||||
CollectionListView()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ import SwiftUI
|
||||
struct PostList: View {
|
||||
@EnvironmentObject var postStore: PostStore
|
||||
@State var selectedCollection: PostCollection
|
||||
@State var isPresentingSettings = false
|
||||
|
||||
var body: some View {
|
||||
#if os(iOS)
|
||||
@ -27,15 +28,27 @@ struct PostList: View {
|
||||
Image(systemName: "square.and.pencil")
|
||||
})
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Button(action: {
|
||||
isPresentingSettings = true
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
}).sheet(
|
||||
isPresented: $isPresentingSettings,
|
||||
onDismiss: {
|
||||
isPresentingSettings = false
|
||||
},
|
||||
content: {
|
||||
SettingsView(isPresented: $isPresentingSettings)
|
||||
}
|
||||
)
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Spacer()
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Text(pluralizedPostCount(for: showPosts(for: selectedCollection)))
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
#else //if os(macOS)
|
||||
List {
|
||||
|
@ -7,7 +7,7 @@ struct SettingsView: View {
|
||||
VStack {
|
||||
SettingsHeaderView(isPresented: $isPresented)
|
||||
Form {
|
||||
Section(header: Text("Account")) {
|
||||
Section(header: Text("Login Details")) {
|
||||
AccountView()
|
||||
}
|
||||
Section(header: Text("Appearance")) {
|
||||
|
Loading…
Reference in New Issue
Block a user