Add Button to present SettingsView in SidebarView

This commit is contained in:
Angelo Stavrow 2020-08-10 12:38:54 -04:00
parent 4d4e4be162
commit afac74a7c9
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -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
}
}