gh-XcodesOrg-XcodesApp/Xcodes/Frontend/Preferences/GeneralPreferencePane.swift
2021-05-01 08:20:54 -06:00

29 lines
793 B
Swift

import AppleAPI
import SwiftUI
struct GeneralPreferencePane: View {
@EnvironmentObject var appState: AppState
var body: some View {
VStack(alignment: .leading) {
GroupBox(label: Text("Apple ID")) {
if appState.authenticationState == .authenticated {
SignedInView()
} else {
Button("Sign In", action: { self.appState.presentedSheet = .signIn })
}
}
.groupBoxStyle(PreferencesGroupBoxStyle())
}
.frame(width: 400)
}
}
struct GeneralPreferencePane_Previews: PreviewProvider {
static var previews: some View {
Group {
GeneralPreferencePane()
.environmentObject(AppState())
}
}
}