mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
42 lines
1.2 KiB
Swift
42 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct SignInCredentialsView: View {
|
|
@EnvironmentObject var appState: AppState
|
|
@Binding var isPresented: Bool
|
|
@State private var username: String = ""
|
|
@State private var password: String = ""
|
|
|
|
var body: some View {
|
|
VStack {
|
|
HStack {
|
|
Text("Apple ID")
|
|
TextField("Apple ID", text: $username)
|
|
}
|
|
|
|
HStack {
|
|
Text("Password")
|
|
SecureField("Password", text: $password)
|
|
}
|
|
|
|
HStack {
|
|
Button("Cancel") {
|
|
isPresented = false
|
|
}
|
|
.keyboardShortcut(.cancelAction)
|
|
Spacer()
|
|
Button("Sign In") {
|
|
appState.continueLogin(username: username, password: password)
|
|
}
|
|
.keyboardShortcut(.defaultAction)
|
|
}
|
|
}
|
|
.padding()
|
|
}
|
|
}
|
|
|
|
struct SignInCredentialsView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
SignInCredentialsView(isPresented: .constant(true))
|
|
.environmentObject(AppState())
|
|
}
|
|
}
|