// // WellnessPrefsView.swift // Tusker // // Created by Shadowfacts on 9/14/19. // Copyright © 2019 Shadowfacts. All rights reserved. // import SwiftUI struct WellnessPrefsView: View { @Preference(\.defaultNotificationsMode) var defaultNotificationsMode: NotificationsMode var body: some View { List { notificationsModeSection }.listStyle(GroupedListStyle()) .navigationBarTitle(Text("Digital Wellness")) } var notificationsModeSection: some View { Section(footer: notificationsModeFooter) { Picker(selection: _defaultNotificationsMode.binding, label: Text("Default Notifications Mode")) { 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() } }