Bubble/Threaded/Views/Settings/SettingsView.swift

68 lines
2.2 KiB
Swift
Raw Normal View History

2023-12-29 11:17:37 +01:00
//Made by Lumaa
import SwiftUI
2024-02-15 23:39:06 +01:00
//TODO: Bring back "Privacy" with mutelist, blocklist and default visibility
2023-12-29 11:17:37 +01:00
struct SettingsView: View {
2024-02-08 08:34:36 +01:00
@Environment(UniversalNavigator.self) private var uniNav: UniversalNavigator
@State var navigator: Navigator
2023-12-29 11:17:37 +01:00
var body: some View {
NavigationStack(path: $navigator.path) {
List {
Section {
Button {
navigator.navigate(to: .about)
} label: {
Label("about", systemImage: "info.circle")
}
.listRowThreaded()
2024-02-12 00:47:39 +01:00
Button {
navigator.presentedCover = .shop
} label: {
Label(String("Threaded+"), systemImage: "plus")
}
.listRowThreaded()
2024-01-27 08:57:22 +01:00
Button {
2024-02-12 02:42:56 +01:00
navigator.navigate(to: .support)
} label: {
2024-02-12 02:42:56 +01:00
Label("setting.support", systemImage: "person.line.dotted.person")
}
.listRowThreaded()
Button {
navigator.navigate(to: .appearence)
} label: {
Label("setting.appearence", systemImage: "rectangle.3.group")
}
.listRowThreaded()
Button {
AppAccount.clear()
2024-01-26 23:12:43 +01:00
navigator.path = []
2024-02-11 18:44:15 +01:00
uniNav.selectedTab = .timeline
2024-02-08 08:34:36 +01:00
uniNav.presentedCover = .welcome
} label: {
Text("logout")
.foregroundStyle(.red)
}
.tint(Color.red)
.listRowThreaded()
}
}
.withAppRouter(navigator)
2024-02-11 18:44:15 +01:00
.withCovers(sheetDestination: $navigator.presentedCover)
.listThreaded()
.navigationTitle("settings")
.navigationBarTitleDisplayMode(.inline)
2023-12-29 11:17:37 +01:00
}
}
}
#Preview {
SettingsView(navigator: .init())
2023-12-29 11:17:37 +01:00
}