2019-06-14 00:53:17 +00:00
|
|
|
// PreferencesView.swift
|
|
|
|
// Tusker
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 6/13/19.
|
|
|
|
// Copyright © 2019 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct PreferencesView : View {
|
|
|
|
var body: some View {
|
|
|
|
// workaround: the navigation view is provided by MyProfileTableViewController so that it can inject the Done button
|
|
|
|
// NavigationView {
|
|
|
|
List {
|
2019-07-18 22:44:35 +00:00
|
|
|
NavigationLink(destination: AppearancePrefsView()) {
|
2019-06-14 00:53:17 +00:00
|
|
|
Text("Appearance")
|
|
|
|
}
|
2019-07-18 22:44:35 +00:00
|
|
|
NavigationLink(destination: BehaviorPrefsView()) {
|
2019-06-14 00:53:17 +00:00
|
|
|
Text("Behavior")
|
|
|
|
}
|
2019-09-14 17:02:33 +00:00
|
|
|
NavigationLink(destination: WellnessPrefsView()) {
|
|
|
|
Text("Digital Wellness")
|
|
|
|
}
|
2019-07-18 22:44:35 +00:00
|
|
|
NavigationLink(destination: AdvancedPrefsView()) {
|
2019-06-14 00:53:17 +00:00
|
|
|
Text("Advanced")
|
|
|
|
}
|
|
|
|
}
|
2019-08-06 03:08:00 +00:00
|
|
|
.listStyle(GroupedListStyle())
|
2019-06-14 00:53:17 +00:00
|
|
|
.navigationBarTitle(Text("Preferences"), displayMode: .inline)
|
2019-08-03 00:05:47 +00:00
|
|
|
.onDisappear {
|
|
|
|
// todo: this onDisappear callback is not called in beta 4, check again in beta 5
|
|
|
|
NotificationCenter.default.post(name: .preferencesChanged, object: nil)
|
|
|
|
}
|
2019-06-14 00:53:17 +00:00
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
struct PreferencesView_Previews : PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
PreferencesView()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|