1+ import FirebaseCore
12import SwiftUI
23
34struct PasswordPromptSheet {
@@ -9,26 +10,47 @@ struct PasswordPromptSheet {
910extension PasswordPromptSheet : View {
1011 var body : some View {
1112 VStack ( spacing: 20 ) {
12- SecureField ( authService. string. passwordInputLabel, text: $password)
13- . textFieldStyle ( . roundedBorder)
13+ Text ( authService. string. confirmPasswordInputLabel)
14+ . font ( . largeTitle)
15+ . fontWeight ( . bold)
1416 . padding ( )
1517
16- HStack {
17- Button ( authService. string. cancelButtonLabel) {
18- coordinator. cancel ( )
19- }
20- Spacer ( )
21- Button ( authService. string. okButtonLabel) {
18+ Divider ( )
19+
20+ LabeledContent {
21+ TextField ( authService. string. passwordInputLabel, text: $password)
22+ . textInputAutocapitalization ( . never)
23+ . disableAutocorrection ( true )
24+ . submitLabel ( . next)
25+ } label: {
26+ Image ( systemName: " lock " )
27+ } . padding ( . vertical, 10 )
28+ . background ( Divider ( ) , alignment: . bottom)
29+ . padding ( . bottom, 4 )
30+
31+ Button ( action: {
32+ Task {
2233 coordinator. submit ( password: password)
2334 }
24- . disabled ( password. isEmpty)
35+ } ) {
36+ Text ( authService. string. okButtonLabel)
37+ . padding ( . vertical, 8 )
38+ . frame ( maxWidth: . infinity)
39+ }
40+ . disabled ( password. isEmpty)
41+ . padding ( [ . top, . bottom, . horizontal] , 8 )
42+ . frame ( maxWidth: . infinity)
43+ . buttonStyle ( . borderedProminent)
44+
45+ Button ( authService. string. cancelButtonLabel) {
46+ coordinator. cancel ( )
2547 }
26- . padding ( . horizontal)
2748 }
2849 . padding ( )
2950 }
3051}
3152
3253#Preview {
33- PasswordPromptSheet ( coordinator: PasswordPromptCoordinator ( ) )
54+ FirebaseOptions . dummyConfigurationForPreview ( )
55+ return PasswordPromptSheet ( coordinator: PasswordPromptCoordinator ( ) ) . environment ( AuthService ( ) )
3456}
0 commit comments