2023-12-29 11:17:37 +01:00
|
|
|
//Made by Lumaa
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct SettingsView: View {
|
|
|
|
@Environment(Navigator.self) private var navigator: Navigator
|
|
|
|
@State private var sheet: SheetDestination?
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
List {
|
|
|
|
Button {
|
|
|
|
navigator.navigate(to: .privacy)
|
|
|
|
} label: {
|
|
|
|
Label("setting.privacy", systemImage: "lock")
|
|
|
|
}
|
|
|
|
// .listRowSeparator(.hidden)
|
|
|
|
.listRowSeparator(.visible)
|
|
|
|
|
|
|
|
Button {
|
|
|
|
UserDefaults.standard.removeObject(forKey: AppAccount.saveKey)
|
|
|
|
sheet = .welcome
|
|
|
|
} label: {
|
|
|
|
Text("logout")
|
2023-12-29 12:53:58 +01:00
|
|
|
.foregroundStyle(.red)
|
2023-12-29 11:17:37 +01:00
|
|
|
}
|
|
|
|
.tint(Color.red)
|
|
|
|
.listRowSeparator(.hidden)
|
|
|
|
}
|
|
|
|
.withCovers(sheetDestination: $sheet)
|
|
|
|
.listStyle(.inset)
|
|
|
|
.navigationTitle("settings")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#Preview {
|
|
|
|
SettingsView()
|
|
|
|
}
|