-
Notifications
You must be signed in to change notification settings - Fork 370
Expand file tree
/
Copy pathGeneralPreferencePane.swift
More file actions
42 lines (37 loc) · 1.33 KB
/
GeneralPreferencePane.swift
File metadata and controls
42 lines (37 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import AppleAPI
import SwiftUI
struct GeneralPreferencePane: View {
@EnvironmentObject var appState: AppState
var body: some View {
VStack(alignment: .leading) {
GroupBox(label: Text("AppleID")) {
if appState.authenticationState == .authenticated {
SignedInView()
} else {
Button("SignIn", action: { self.appState.presentedSheet = .signIn })
}
}
.groupBoxStyle(PreferencesGroupBoxStyle())
Divider()
GroupBox(label: Text("Notifications")) {
NotificationsView().environmentObject(appState)
}
.groupBoxStyle(PreferencesGroupBoxStyle())
Divider()
GroupBox(label: Text("Misc")) {
Toggle("TerminateAfterLastWindowClosed", isOn: $appState.terminateAfterLastWindowClosed)
Toggle("EnableCollapsibleList", isOn: $appState.collapsableListEnabled)
}
.groupBoxStyle(PreferencesGroupBoxStyle())
}
}
}
struct GeneralPreferencePane_Previews: PreviewProvider {
static var previews: some View {
Group {
GeneralPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 600)
}
}
}