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
|
2024-01-02 14:23:36 +01:00
|
|
|
@State var navigator: Navigator
|
2023-12-29 11:17:37 +01:00
|
|
|
|
|
|
|
var body: some View {
|
2024-01-02 14:23:36 +01:00
|
|
|
NavigationStack(path: $navigator.path) {
|
|
|
|
List {
|
2024-01-04 22:19:35 +01:00
|
|
|
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
|
|
|
|
2024-01-04 22:19:35 +01:00
|
|
|
Button {
|
2024-02-12 02:42:56 +01:00
|
|
|
navigator.navigate(to: .support)
|
2024-01-04 22:19:35 +01:00
|
|
|
} label: {
|
2024-02-12 02:42:56 +01:00
|
|
|
Label("setting.support", systemImage: "person.line.dotted.person")
|
2024-01-04 22:19:35 +01:00
|
|
|
}
|
|
|
|
.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
|
2024-01-04 22:19:35 +01:00
|
|
|
} label: {
|
|
|
|
Text("logout")
|
|
|
|
.foregroundStyle(.red)
|
|
|
|
}
|
|
|
|
.tint(Color.red)
|
|
|
|
.listRowThreaded()
|
2024-01-02 14:23:36 +01:00
|
|
|
}
|
2023-12-30 20:59:09 +01:00
|
|
|
}
|
2024-01-02 14:23:36 +01:00
|
|
|
.withAppRouter(navigator)
|
2024-02-11 18:44:15 +01:00
|
|
|
.withCovers(sheetDestination: $navigator.presentedCover)
|
2024-01-04 22:19:35 +01:00
|
|
|
.listThreaded()
|
2024-01-02 14:23:36 +01:00
|
|
|
.navigationTitle("settings")
|
|
|
|
.navigationBarTitleDisplayMode(.inline)
|
2023-12-29 11:17:37 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#Preview {
|
2024-01-02 14:23:36 +01:00
|
|
|
SettingsView(navigator: .init())
|
2023-12-29 11:17:37 +01:00
|
|
|
}
|