Skip to content

Commit 77762b8

Browse files
password prompt sheet
1 parent c115f7c commit 77762b8

File tree

3 files changed

+13
-24
lines changed

3 files changed

+13
-24
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Strings/Localizable.xcstrings

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@
233233
}
234234
}
235235
}
236-
},
237-
"Confirm password" : {
238-
239236
},
240237
"ConfirmEmail" : {
241238
"comment" : "Title of confirm email label.",
@@ -378,9 +375,6 @@
378375
}
379376
}
380377
},
381-
"Email" : {
382-
"comment" : "Label next to a email text field. Use short/abbreviated translation for 'email' which is less than 15 chars."
383-
},
384378
"EmailAlreadyInUseError" : {
385379
"comment" : "Error message displayed when the email address is already in use. Use short/abbreviated translation for 'email' which is less than 15 chars.",
386380
"extractionState" : "migrated",
@@ -557,9 +551,6 @@
557551
},
558552
"Log in" : {
559553

560-
},
561-
"Log in with password" : {
562-
563554
},
564555
"Login" : {
565556

@@ -719,15 +710,9 @@
719710
}
720711
}
721712
}
722-
},
723-
"Please check your email for email sign-in link." : {
724-
725713
},
726714
"Please check your email for verification link." : {
727715

728-
},
729-
"Prefer Email link sign-in?" : {
730-
731716
},
732717
"PrivacyPolicy" : {
733718
"comment" : "Text linked to a web page with the Privacy Policy content.",
@@ -848,9 +833,6 @@
848833
}
849834
}
850835
}
851-
},
852-
"Send email sign-in link" : {
853-
854836
},
855837
"SendEmailSignInLinkButtonLabel" : {
856838
"comment" : "Button label for sending email sign-in link",
@@ -863,9 +845,6 @@
863845
}
864846
}
865847
}
866-
},
867-
"Sign in with email link" : {
868-
869848
},
870849
"Sign out" : {
871850

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public class StringUtils {
8585
/// Password input label
8686
/// found in:
8787
/// - EmailAuthView
88+
/// - PasswordPromptView
8889
public var passwordInputLabel: String {
8990
return localizedString(for: "EnterYourPassword")
9091
}
@@ -192,7 +193,15 @@ public class StringUtils {
192193
/// found in:
193194
/// - PasswordRecoveryView
194195
/// - EmailLinkView
196+
/// - PasswordPromptView
195197
public var okButtonLabel: String {
196198
return localizedString(for: "OK")
197199
}
200+
201+
/// General string - Cancel button label
202+
/// found in:
203+
/// - PasswordPromptView
204+
public var cancelButtonLabel: String {
205+
return localizedString(for: "Cancel")
206+
}
198207
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/PasswordPromptView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
import SwiftUI
22

33
struct PasswordPromptSheet {
4+
@Environment(AuthService.self) private var authService
45
@Bindable var coordinator: PasswordPromptCoordinator
56
@State private var password = ""
67
}
78

89
extension PasswordPromptSheet: View {
910
var body: some View {
1011
VStack(spacing: 20) {
11-
SecureField("Enter Password", text: $password)
12+
SecureField(authService.string.passwordInputLabel, text: $password)
1213
.textFieldStyle(.roundedBorder)
1314
.padding()
1415

1516
HStack {
16-
Button("Cancel") {
17+
Button(authService.string.cancelButtonLabel) {
1718
coordinator.cancel()
1819
}
1920
Spacer()
20-
Button("Submit") {
21+
Button(authService.string.okButtonLabel) {
2122
coordinator.submit(password: password)
2223
}
2324
.disabled(password.isEmpty)

0 commit comments

Comments
 (0)