Tusker/Tusker/Screens/Preferences/WellnessPrefsView.swift

56 lines
1.7 KiB
Swift
Raw Normal View History

//
// WellnessPrefsView.swift
// Tusker
//
// Created by Shadowfacts on 9/14/19.
// Copyright © 2019 Shadowfacts. All rights reserved.
//
import SwiftUI
struct WellnessPrefsView: View {
2020-11-01 18:59:58 +00:00
@ObservedObject private var preferences = Preferences.shared
var body: some View {
List {
2020-11-01 18:59:58 +00:00
showFavAndReblogCount
notificationsMode
grayscaleImages
}
2021-02-06 18:47:45 +00:00
.listStyle(InsetGroupedListStyle())
.navigationBarTitle(Text("Digital Wellness"))
}
2020-11-01 18:59:58 +00:00
private var showFavAndReblogCount: some View {
Section(footer: Text("Control whether total favorite and reblog counts are shown for the main post in conversations.")) {
Toggle(isOn: $preferences.showFavoriteAndReblogCounts) {
Text("Show Favorite and Reblog Counts")
}
}
}
2020-11-01 18:59:58 +00:00
private var notificationsMode: some View {
Section(footer: Text("Choose which kinds of notifications will be shown by default in the Notifications tab.")) {
Picker(selection: $preferences.defaultNotificationsMode, label: Text("Default Notifications Mode")) {
ForEach(NotificationsMode.allCases, id: \.self) { type in
Text(type.displayName).tag(type)
}
}
}
}
2020-11-01 18:59:58 +00:00
private var grayscaleImages: some View {
Section(footer: Text("Show attachments, avatars, headers, and custom emoji in black and white.")) {
Toggle(isOn: $preferences.grayscaleImages) {
Text("Grayscale Images")
}
}
}
}
struct WellnessPrefsView_Previews: PreviewProvider {
static var previews: some View {
WellnessPrefsView()
}
}