Add gear in customize for for settings
This commit is contained in:
@@ -8,12 +8,14 @@
|
||||
import SwiftUI
|
||||
|
||||
struct CustomizeView: View {
|
||||
@State private var showSettings = false
|
||||
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
settingsButtonView
|
||||
VStack {
|
||||
Group {
|
||||
CustomWigetView()
|
||||
@@ -38,6 +40,9 @@ struct CustomizeView: View {
|
||||
.onAppear(perform: {
|
||||
EventLogger.log(event: "show_customize_view")
|
||||
})
|
||||
.sheet(isPresented: $showSettings) {
|
||||
SettingsView()
|
||||
}
|
||||
.padding()
|
||||
.background(
|
||||
theme.currentTheme.bg
|
||||
@@ -45,6 +50,19 @@ struct CustomizeView: View {
|
||||
)
|
||||
}
|
||||
|
||||
private var settingsButtonView: some View {
|
||||
HStack {
|
||||
Spacer()
|
||||
Button(action: {
|
||||
showSettings.toggle()
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
.foregroundColor(Color(UIColor.darkGray))
|
||||
.font(.system(size: 20))
|
||||
}).padding(.trailing)
|
||||
}
|
||||
}
|
||||
|
||||
private var sampleEntryView: some View {
|
||||
ZStack {
|
||||
theme.currentTheme.secondaryBGColor
|
||||
|
||||
Reference in New Issue
Block a user