Skip to content

Commit c115f7c

Browse files
email link view
1 parent 61f461b commit c115f7c

File tree

3 files changed

+57
-14
lines changed

3 files changed

+57
-14
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Strings/Localizable.xcstrings

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
}
395395
},
396396
"EmailLinkSignInLabel" : {
397-
"comment" : "Button label for email link sign-in",
397+
"comment" : "Button label to push user to email link sign-in",
398398
"extractionState" : "manual",
399399
"localizations" : {
400400
"en" : {
@@ -405,6 +405,18 @@
405405
}
406406
}
407407
},
408+
"EmailLinkSignInTitle" : {
409+
"comment" : "Sign in with email link View title",
410+
"extractionState" : "manual",
411+
"localizations" : {
412+
"en" : {
413+
"stringUnit" : {
414+
"state" : "translated",
415+
"value" : "Sign in with email link"
416+
}
417+
}
418+
}
419+
},
408420
"EmailsDontMatch" : {
409421
"comment" : "Error message displayed when after re-authorization current user's email and re-authorized user's email doesn't match. Use short/abbreviated translation for 'email' which is less than 15 chars.",
410422
"extractionState" : "manual",
@@ -543,9 +555,6 @@
543555
}
544556
}
545557
},
546-
"Key" : {
547-
"extractionState" : "manual"
548-
},
549558
"Log in" : {
550559

551560
},
@@ -842,6 +851,18 @@
842851
},
843852
"Send email sign-in link" : {
844853

854+
},
855+
"SendEmailSignInLinkButtonLabel" : {
856+
"comment" : "Button label for sending email sign-in link",
857+
"extractionState" : "manual",
858+
"localizations" : {
859+
"en" : {
860+
"stringUnit" : {
861+
"state" : "translated",
862+
"value" : "Send email sign-in link"
863+
}
864+
}
865+
}
845866
},
846867
"Sign in with email link" : {
847868

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public class StringUtils {
7070
/// found in:
7171
/// - EmailAuthView
7272
/// - PasswordRecoveryView
73+
/// - EmailLinkView
7374
public var emailInputLabel: String {
7475
return localizedString(for: "EnterYourEmail")
7576
}
@@ -139,7 +140,7 @@ public class StringUtils {
139140

140141
/// Sign in with email button label or can be used as title
141142
/// found in:
142-
/// EmailAuthView
143+
/// - EmailAuthView
143144
public var signInWithEmailButtonLabel: String {
144145
return localizedString(for: "SignInWithEmail")
145146
}
@@ -151,23 +152,46 @@ public class StringUtils {
151152
return localizedString(for: "SignUpTitle")
152153
}
153154

154-
/// Sign up with email link button label
155+
/// Sign-in with email link button label to push user to email link view
155156
/// found in:
156157
/// - EmailAuthView
157158
public var signUpWithEmailLinkButtonLabel: String {
158159
return localizedString(for: "EmailLinkSignInLabel")
159160
}
160161

162+
/// send email link sign-in button label
163+
/// found in:
164+
/// - EmailLinkView
165+
public var sendEmailLinkButtonLabel: String {
166+
return localizedString(for: "SendEmailSignInLinkButtonLabel")
167+
}
168+
169+
/// Sign in with email link View title
170+
/// found in:
171+
/// - EmailLinkView
172+
public var signInWithEmailLinkViewTitle: String {
173+
return localizedString(for: "EmailLinkSignInTitle")
174+
}
175+
176+
/// Sign in with email link View message
177+
/// found in:
178+
/// - EmailLinkView
179+
public var signInWithEmailLinkViewMessage: String {
180+
return localizedString(for: "SignInEmailSent")
181+
}
182+
161183
/// General string - Back button label
162184
/// found in:
163185
/// - PasswordRecoveryView
186+
/// - EmailLinkView
164187
public var backButtonLabel: String {
165188
return localizedString(for: "Back")
166189
}
167190

168191
/// General string - OK button label
169192
/// found in:
170193
/// - PasswordRecoveryView
194+
/// - EmailLinkView
171195
public var okButtonLabel: String {
172196
return localizedString(for: "OK")
173197
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailLinkView.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public struct EmailLinkView {
1919
extension EmailLinkView: View {
2020
public var body: some View {
2121
VStack {
22-
Text("Sign in with email link")
22+
Text(authService.string.signInWithEmailLinkViewTitle)
2323
LabeledContent {
24-
TextField("Email", text: $email)
24+
TextField(authService.string.emailInputLabel, text: $email)
2525
.textInputAutocapitalization(.never)
2626
.disableAutocorrection(true)
2727
.submitLabel(.next)
@@ -36,7 +36,7 @@ extension EmailLinkView: View {
3636
authService.emailLink = email
3737
}
3838
}) {
39-
Text("Send email sign-in link")
39+
Text(authService.string.sendEmailLinkButtonLabel)
4040
.padding(.vertical, 8)
4141
.frame(maxWidth: .infinity)
4242
}
@@ -47,11 +47,9 @@ extension EmailLinkView: View {
4747
Text(authService.errorMessage).foregroundColor(.red)
4848
}.sheet(isPresented: $showModal) {
4949
VStack {
50-
Text("Instructions")
51-
.font(.headline)
52-
Text("Please check your email for email sign-in link.")
50+
Text(authService.string.signInWithEmailLinkViewMessage)
5351
.padding()
54-
Button("Dismiss") {
52+
Button(authService.string.okButtonLabel) {
5553
showModal = false
5654
}
5755
.padding()
@@ -69,7 +67,7 @@ extension EmailLinkView: View {
6967
}) {
7068
Image(systemName: "chevron.left")
7169
.foregroundColor(.blue)
72-
Text("Back")
70+
Text(authService.string.backButtonLabel)
7371
.foregroundColor(.blue)
7472
})
7573
}

0 commit comments

Comments
 (0)