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 {
|
2020-11-01 18:59:58 +00:00
|
|
|
@ObservedObject private var preferences = Preferences.shared
|
2019-11-15 00:53:00 +00:00
|
|
|
|
2019-09-14 17:02:33 +00:00
|
|
|
var body: some View {
|
|
|
|
List {
|
2020-11-01 18:59:58 +00:00
|
|
|
showFavAndReblogCount
|
|
|
|
notificationsMode
|
|
|
|
grayscaleImages
|
2022-07-01 01:41:05 +00:00
|
|
|
disableInfiniteScrolling
|
2022-04-01 23:23:49 +00:00
|
|
|
hideDiscover
|
2020-09-16 00:46:49 +00:00
|
|
|
}
|
2021-02-06 18:47:45 +00:00
|
|
|
.listStyle(InsetGroupedListStyle())
|
2020-09-16 00:46:49 +00:00
|
|
|
.navigationBarTitle(Text("Digital Wellness"))
|
2019-09-14 17:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-11-01 18:59:58 +00:00
|
|
|
private var showFavAndReblogCount: some View {
|
2022-12-05 00:50:15 +00:00
|
|
|
Section(footer: Text("Control whether the focused post in the conversation view shows total favorite and reblog counts.")) {
|
2019-11-15 00:53:00 +00:00
|
|
|
Toggle(isOn: $preferences.showFavoriteAndReblogCounts) {
|
2022-12-05 00:50:15 +00:00
|
|
|
Text("Favorite and Reblog Counts in Conversations")
|
2019-09-14 18:55:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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.")) {
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
2019-09-14 17:02:33 +00:00
|
|
|
}
|
2021-06-26 03:28:14 +00:00
|
|
|
|
|
|
|
private var disableInfiniteScrolling: some View {
|
|
|
|
Section(footer: Text("Require a button tap before loading more posts.")) {
|
|
|
|
Toggle(isOn: $preferences.disableInfiniteScrolling) {
|
|
|
|
Text("Disable Infinite Scrolling")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-01 23:23:49 +00:00
|
|
|
|
|
|
|
private var hideDiscover: some View {
|
|
|
|
Section(footer: Text("Do not show the Discover section (Trends, Profile Directory) of the Explore screen or sidebar.")) {
|
|
|
|
Toggle(isOn: $preferences.hideDiscover) {
|
|
|
|
Text("Hide Discover Section")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-14 17:02:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct WellnessPrefsView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
WellnessPrefsView()
|
|
|
|
}
|
|
|
|
}
|