2019-09-14 17:02:33 +00:00
|
|
|
//
|
|
|
|
// WellnessPrefsView.swift
|
|
|
|
// Tusker
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 9/14/19.
|
|
|
|
// Copyright © 2019 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct WellnessPrefsView: View {
|
2019-11-15 00:53:00 +00:00
|
|
|
@ObservedObject var preferences = Preferences.shared
|
|
|
|
|
2019-09-14 17:02:33 +00:00
|
|
|
var body: some View {
|
|
|
|
List {
|
2019-09-14 18:55:30 +00:00
|
|
|
showFavAndReblogCountSection
|
2019-09-14 17:02:33 +00:00
|
|
|
notificationsModeSection
|
2020-09-16 00:46:49 +00:00
|
|
|
}
|
|
|
|
.insetOrGroupedListStyle()
|
|
|
|
.navigationBarTitle(Text("Digital Wellness"))
|
2019-09-14 17:02:33 +00:00
|
|
|
}
|
|
|
|
|
2019-09-14 18:55:30 +00:00
|
|
|
var showFavAndReblogCountSection: some View {
|
|
|
|
Section(footer: showFavAndReblogCountFooter) {
|
2019-11-15 00:53:00 +00:00
|
|
|
Toggle(isOn: $preferences.showFavoriteAndReblogCounts) {
|
2019-09-14 18:55:30 +00:00
|
|
|
Text("Show Favorite and Reblog Counts")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var showFavAndReblogCountFooter: some View {
|
|
|
|
Text("Control whether total favorite and reblog counts are shown for the main post in conversations.")
|
|
|
|
}
|
|
|
|
|
2019-09-14 17:02:33 +00:00
|
|
|
var notificationsModeSection: some View {
|
|
|
|
Section(footer: notificationsModeFooter) {
|
2019-11-15 00:53:00 +00:00
|
|
|
Picker(selection: $preferences.defaultNotificationsMode, label: Text("Default Notifications Mode")) {
|
2019-09-14 17:02:33 +00:00
|
|
|
ForEach(NotificationsMode.allCases, id: \.self) { type in
|
|
|
|
Text(type.displayName).tag(type)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var notificationsModeFooter: some View {
|
|
|
|
Text("Choose which kinds of notifications will be shown by default in the Notifications tab.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct WellnessPrefsView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
WellnessPrefsView()
|
|
|
|
}
|
|
|
|
}
|