gh-XcodesOrg-XcodesApp/Xcodes/Frontend/Preferences/GeneralPreferencePane.swift
2022-04-17 21:29:51 -05:00

35 lines
1,012 B
Swift

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())
}
.frame(width: 500)
}
}
struct GeneralPreferencePane_Previews: PreviewProvider {
static var previews: some View {
Group {
GeneralPreferencePane()
.environmentObject(AppState())
}
}
}