Skip to content

Commit

Permalink
🔀 Merge branch 'hugo/feature/Add-verification-mail-alert'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 22, 2024
2 parents 2ae9857 + a4ce389 commit 618842c
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
54 changes: 54 additions & 0 deletions Apps/LekaApp/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,60 @@
}
}
},
"lekaapp.account_creation_view.email_verification_alert.dismissButton": {
"comment": "Email verification alert dismiss button",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "OK"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "OK"
}
}
}
},
"lekaapp.account_creation_view.email_verification_alert.message": {
"comment": "Email verification alert message",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "An email has been sent to the address provided. Please click on the link to confirm your email address."
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Un email a \u00e9t\u00e9 envoy\u00e9 \u00e0 l'adresse indiqu\u00e9e. Veuillez cliquer sur le lien pour confirmer votre adresse e-mail."
}
}
}
},
"lekaapp.account_creation_view.email_verification_alert.title": {
"comment": "Email verification alert title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Confirm your email address"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Confirmez votre adresse email"
}
}
}
},
"lekaapp.account_creation_view.navigation_title": {
"comment": "NavigationBar title on the whole Signup process",
"extractionState": "extracted_with_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@

import LocalizationKit

// swiftlint:disable line_length
// swiftlint:disable line_length nesting

extension l10n {
enum AccountCreationView {
enum EmailVerificationAlert {
static let title = LocalizedString("lekaapp.account_creation_view.email_verification_alert.title", value: "Confirm your email address", comment: "Email verification alert title")

static let message = LocalizedString("lekaapp.account_creation_view.email_verification_alert.message",
value: "An email has been sent to the address provided. Please click on the link to confirm your email address.",
comment: "Email verification alert message")

static let dismissButton = LocalizedString("lekaapp.account_creation_view.email_verification_alert.dismissButton", value: "OK", comment: "Email verification alert dismiss button")
}

static let createAccountTitle = LocalizedString("lekaapp.account_creation_view.create_account_title", value: "Create an account", comment: "Create account title on SignupView")

static let connectionButton = LocalizedString("lekaapp.account_creation_view.connection_button", value: "Connection", comment: "Connection button on SignupView")
}
}

// swiftlint:enable line_length
// swiftlint:enable line_length nesting
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ struct AccountCreationView: View {
.onChange(of: self.authManagerViewModel.userAuthenticationState) { newValue in
if newValue == .loggedIn {
self.authManagerViewModel.userIsSigningUp = true
self.viewModel.navigateToAccountCreationProcess.toggle()
self.isVerificationEmailAlertPresented = true
} else {
// display signup failed alert
}
}
.alert(isPresented: self.$isVerificationEmailAlertPresented) {
Alert(title: Text(l10n.AccountCreationView.EmailVerificationAlert.title),
message: Text(l10n.AccountCreationView.EmailVerificationAlert.message),
dismissButton: .default(Text(l10n.AccountCreationView.EmailVerificationAlert.dismissButton)) {
self.viewModel.navigateToAccountCreationProcess.toggle()
})
}
}

// MARK: Private

@State private var isVerificationEmailAlertPresented: Bool = false
@StateObject private var viewModel = AccountCreationViewViewModel()
@ObservedObject private var authManagerViewModel = AuthManagerViewModel.shared
private var authManager = AuthManager.shared
Expand Down

0 comments on commit 618842c

Please sign in to comment.