mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Add Button to present SettingsView in SidebarView
This commit is contained in:
parent
4d4e4be162
commit
afac74a7c9
@ -1,8 +1,30 @@
|
||||
import SwiftUI
|
||||
|
||||
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()
|
||||
}
|
||||
)
|
||||
}
|
||||
#else
|
||||
CollectionListView()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user