-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLoginPageView.swift
56 lines (49 loc) · 1.63 KB
/
LoginPageView.swift
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// WelcomePageView.swift
// MobileAcebook
//
// Created by Josué Estévez Fernández on 30/09/2023.
//
import SwiftUI
struct LoginPageView: View {
@State private var username = ""
@State private var password = ""
var body: some View {
NavigationView {
VStack {
Spacer()
Text("Log in")
.font(.largeTitle)
.bold()
Spacer()
Text("Username")
TextField("", text: $username)
.frame(width: 220, height: 40)
.textFieldStyle(.roundedBorder)
.multilineTextAlignment(.center)
.accessibilityIdentifier("loginUsername")
Text("Password")
TextField("", text: $password)
.frame(width: 220, height: 40)
.textFieldStyle(.roundedBorder)
.multilineTextAlignment(.center)
.accessibilityIdentifier("loginPassword")
.padding()
Button("Submit") {
guard !username.isEmpty && !password.isEmpty else { return }
}
.frame(width: 220, height: 40)
.background(Color(red: 0x50/255, green: 0xB7/255, blue: 0xB7/255))
.foregroundColor(.white)
.cornerRadius(5)
Spacer()
Spacer()
}
}
}
}
struct LoginPageView_Previews: PreviewProvider {
static var previews: some View {
LoginPageView()
}
}