From ba12cd3c3494f240294131efc97158b9b5d80c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Moli=C5=84ski?= <47773413+damian-molinski@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:59:15 +0200 Subject: [PATCH] feat(cat-voices): account restored (#997) * feat: account restored panel * docs: check local keychains * feat: exit dialog --- .../recover/recover_seed_phrase_panel.dart | 4 +- .../recover/seed_phrase/restored_panel.dart | 59 ++++++++++++ .../registration/registration_dialog.dart | 44 +++++++-- .../registration_exit_confirm_dialog.dart | 55 ----------- .../wallet_link/account_role_dialog.dart | 5 +- .../stage/roles_chooser_panel.dart | 2 +- .../widgets/exit_confirm_dialog.dart | 96 +++++++++++++++++++ .../widgets/placeholder_panel.dart | 18 ---- .../registration/cubits/recover_cubit.dart | 3 + .../catalyst_voices_localizations.dart | 46 ++++++++- .../catalyst_voices_localizations_en.dart | 23 ++++- .../catalyst_voices_localizations_es.dart | 23 ++++- .../lib/l10n/intl_en.arb | 11 ++- .../src/registration/registration_step.dart | 16 ++++ 14 files changed, 315 insertions(+), 90 deletions(-) create mode 100644 catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart delete mode 100644 catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart create mode 100644 catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart delete mode 100644 catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart diff --git a/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart b/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart index 406e21b887..717b138d19 100644 --- a/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart +++ b/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart @@ -1,9 +1,9 @@ import 'package:catalyst_voices/pages/registration/recover/seed_phrase/account_details_panel.dart'; +import 'package:catalyst_voices/pages/registration/recover/seed_phrase/restored_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/seed_phrase_input_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/seed_phrase_instructions_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/unlock_password_instructions_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/unlock_password_panel.dart'; -import 'package:catalyst_voices/pages/registration/widgets/placeholder_panel.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; import 'package:flutter/material.dart'; @@ -25,7 +25,7 @@ class RecoverSeedPhrasePanel extends StatelessWidget { RecoverSeedPhraseStage.unlockPasswordInstructions => const UnlockPasswordInstructionsPanel(), RecoverSeedPhraseStage.unlockPassword => const UnlockPasswordPanel(), - RecoverSeedPhraseStage.success => const PlaceholderPanel(), + RecoverSeedPhraseStage.success => const RestoredPanel(), }; } } diff --git a/catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart b/catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart new file mode 100644 index 0000000000..26f72e7b12 --- /dev/null +++ b/catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart @@ -0,0 +1,59 @@ +import 'package:catalyst_voices/routes/routes.dart'; +import 'package:catalyst_voices/widgets/buttons/voices_filled_button.dart'; +import 'package:catalyst_voices/widgets/buttons/voices_text_button.dart'; +import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; +import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; +import 'package:flutter/material.dart'; + +class RestoredPanel extends StatelessWidget { + const RestoredPanel({super.key}); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + + final textTheme = theme.textTheme; + final colors = theme.colors; + + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox(height: 24), + Text( + context.l10n.recoverySuccessTitle, + style: textTheme.titleLarge?.copyWith( + color: colors.textOnPrimaryLevel1, + ), + ), + const SizedBox(height: 24), + Text( + context.l10n.recoverySuccessSubtitle, + style: textTheme.bodyMedium?.copyWith( + color: colors.textOnPrimaryLevel0, + ), + ), + const Spacer(), + const SizedBox(height: 10), + VoicesFilledButton( + onTap: () => _redirectToDashboard(context), + child: Text(context.l10n.recoverySuccessGoToDashboard), + ), + const SizedBox(height: 10), + VoicesTextButton( + onTap: () => _redirectToMyAccount(context), + child: Text(context.l10n.recoverySuccessGoAccount), + ), + ], + ); + } + + void _redirectToDashboard(BuildContext context) { + Navigator.of(context).pop(); + const DiscoveryRoute().go(context); + } + + void _redirectToMyAccount(BuildContext context) { + Navigator.of(context).pop(); + const AccountRoute().go(context); + } +} diff --git a/catalyst_voices/lib/pages/registration/registration_dialog.dart b/catalyst_voices/lib/pages/registration/registration_dialog.dart index 4fe7c02d9f..172ebc3fd4 100644 --- a/catalyst_voices/lib/pages/registration/registration_dialog.dart +++ b/catalyst_voices/lib/pages/registration/registration_dialog.dart @@ -3,8 +3,8 @@ import 'dart:async'; import 'package:catalyst_voices/common/error_handler.dart'; import 'package:catalyst_voices/dependency/dependencies.dart'; import 'package:catalyst_voices/pages/registration/registration_details_panel.dart'; -import 'package:catalyst_voices/pages/registration/registration_exit_confirm_dialog.dart'; import 'package:catalyst_voices/pages/registration/registration_info_panel.dart'; +import 'package:catalyst_voices/pages/registration/widgets/exit_confirm_dialog.dart'; import 'package:catalyst_voices/widgets/widgets.dart'; import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; @@ -55,7 +55,12 @@ class _RegistrationDialogState extends State child: PopScope( canPop: false, onPopInvokedWithResult: (didPop, result) { - unawaited(_confirmedExit(context, didPop: didPop)); + unawaited( + _handlePop( + context, + didPop: didPop, + ), + ); }, child: BlocSelector( selector: (state) => state.step is! AccountCompletedStep, @@ -71,7 +76,7 @@ class _RegistrationDialogState extends State ); } - Future _confirmedExit( + Future _handlePop( BuildContext context, { required bool didPop, }) async { @@ -79,13 +84,38 @@ class _RegistrationDialogState extends State return; } - final confirmed = await VoicesQuestionDialog.show( - context, - builder: (_) => const RegistrationExitConfirmDialog(), - ); + final state = _cubit.state; + final hasProgress = (state.progress ?? 0.0) > 0.0; + if (!hasProgress) { + Navigator.of(context).pop(); + return; + } + + final confirmed = await _confirmExit(context, step: state.step); if (context.mounted && confirmed) { Navigator.of(context).pop(); } } + + Future _confirmExit( + BuildContext context, { + required RegistrationStep step, + }) { + if (step.isRegistrationFlow) { + return VoicesQuestionDialog.show( + context, + builder: (_) => const RegistrationExitConfirmDialog(), + ); + } + + if (step.isRecoverFlow) { + return VoicesQuestionDialog.show( + context, + builder: (_) => const RecoveryExitConfirmDialog(), + ); + } + + return Future.value(true); + } } diff --git a/catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart b/catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart deleted file mode 100644 index e8a8a1f0fa..0000000000 --- a/catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:catalyst_voices/widgets/widgets.dart'; -import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; -import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; -import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; -import 'package:flutter/material.dart'; - -class RegistrationExitConfirmDialog extends StatelessWidget { - const RegistrationExitConfirmDialog({super.key}); - - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - - return VoicesQuestionDialog( - title: Text(l10n.warning.toUpperCase()), - icon: const _WarningIcon(), - subtitle: Text(l10n.registrationExitConfirmDialogSubtitle.toUpperCase()), - content: Padding( - padding: const EdgeInsets.only(bottom: 30), - child: Text(l10n.registrationExitConfirmDialogContent), - ), - actions: [ - VoicesQuestionActionItem.negative( - l10n.registrationExitConfirmDialogContinue, - type: VoicesQuestionActionType.filled, - ), - VoicesQuestionActionItem.positive( - l10n.registrationExitConfirmDialogCancel, - type: VoicesQuestionActionType.text, - ), - ], - ); - } -} - -class _WarningIcon extends StatelessWidget { - const _WarningIcon(); - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - final color = theme.colors.iconsError!; - - return VoicesAvatar( - border: Border.all( - color: color, - width: 3, - ), - icon: VoicesAssets.icons.exclamation.buildIcon(size: 36), - backgroundColor: Colors.transparent, - foregroundColor: color, - radius: 40, - ); - } -} diff --git a/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart b/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart index 6f441b987c..1b670d444e 100644 --- a/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart +++ b/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart @@ -16,7 +16,10 @@ class AccountRoleDialog extends StatelessWidget { super.key, }); - static Future show(BuildContext context, AccountRole role) async { + static Future show( + BuildContext context, { + required AccountRole role, + }) async { return VoicesDialog.show( context: context, builder: (context) { diff --git a/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart b/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart index 229686a055..09fdde6561 100644 --- a/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart +++ b/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart @@ -65,7 +65,7 @@ class _BlocRolesChooserContainer extends StatelessWidget { onLearnMore: (role) async { await AccountRoleDialog.show( context, - role, + role: role, ); }, ); diff --git a/catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart b/catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart new file mode 100644 index 0000000000..95d0948a67 --- /dev/null +++ b/catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart @@ -0,0 +1,96 @@ +import 'package:catalyst_voices/widgets/widgets.dart'; +import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; +import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; +import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; +import 'package:flutter/material.dart'; + +class RecoveryExitConfirmDialog extends StatelessWidget { + const RecoveryExitConfirmDialog({super.key}); + + @override + Widget build(BuildContext context) { + return ExitConfirmDialog( + title: context.l10n.warning, + subtitle: context.l10n.recoveryExitConfirmDialogSubtitle, + content: context.l10n.recoveryExitConfirmDialogContent, + positive: context.l10n.recoveryExitConfirmDialogContinue, + negative: context.l10n.cancelAnyways, + ); + } +} + +class RegistrationExitConfirmDialog extends StatelessWidget { + const RegistrationExitConfirmDialog({super.key}); + + @override + Widget build(BuildContext context) { + return ExitConfirmDialog( + title: context.l10n.warning, + subtitle: context.l10n.registrationExitConfirmDialogSubtitle, + content: context.l10n.registrationExitConfirmDialogContent, + positive: context.l10n.registrationExitConfirmDialogContinue, + negative: context.l10n.cancelAnyways, + ); + } +} + +class ExitConfirmDialog extends StatelessWidget { + final String title; + final String subtitle; + final String content; + final String positive; + final String negative; + + const ExitConfirmDialog({ + super.key, + required this.title, + required this.subtitle, + required this.content, + required this.positive, + required this.negative, + }); + + @override + Widget build(BuildContext context) { + return VoicesQuestionDialog( + title: Text(title.toUpperCase()), + icon: const _WarningIcon(), + subtitle: Text(subtitle.toUpperCase()), + content: Padding( + padding: const EdgeInsets.only(bottom: 30), + child: Text(content), + ), + actions: [ + VoicesQuestionActionItem.negative( + positive, + type: VoicesQuestionActionType.filled, + ), + VoicesQuestionActionItem.positive( + negative, + type: VoicesQuestionActionType.text, + ), + ], + ); + } +} + +class _WarningIcon extends StatelessWidget { + const _WarningIcon(); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final color = theme.colors.iconsError!; + + return VoicesAvatar( + border: Border.all( + color: color, + width: 3, + ), + icon: VoicesAssets.icons.exclamation.buildIcon(size: 36), + backgroundColor: Colors.transparent, + foregroundColor: color, + radius: 40, + ); + } +} diff --git a/catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart b/catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart deleted file mode 100644 index 345d404efb..0000000000 --- a/catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:catalyst_voices/pages/registration/widgets/registration_stage_navigation.dart'; -import 'package:flutter/material.dart'; - -/// Temporary panel with next/back buttons. -class PlaceholderPanel extends StatelessWidget { - const PlaceholderPanel({super.key}); - - @override - Widget build(BuildContext context) { - return const Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Spacer(), - RegistrationBackNextNavigation(), - ], - ); - } -} diff --git a/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart b/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart index 2e7ffb80e8..c961b7e75e 100644 --- a/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart +++ b/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart @@ -41,6 +41,9 @@ final class RecoverCubit extends Cubit } } + // Note. this function will have more sense when we'll implement + // multi account feature. Then we can have multiple keychains and lookup + // those already stored locally. @override Future checkLocalKeychains() async { // TODO(damian-molinski): to be implemented diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart index 5fa4047215..c3c0f2037a 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart @@ -1624,11 +1624,11 @@ abstract class VoicesLocalizations { /// **'Continue keychain creation'** String get registrationExitConfirmDialogContinue; - /// No description provided for @registrationExitConfirmDialogCancel. + /// No description provided for @cancelAnyways. /// /// In en, this message translates to: /// **'Cancel anyway'** - String get registrationExitConfirmDialogCancel; + String get cancelAnyways; /// No description provided for @recoverCatalystKeychain. /// @@ -1731,6 +1731,48 @@ abstract class VoicesLocalizations { /// In en, this message translates to: /// **'With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. 

But it can be a bit tedious to enter every single time you want to use the app. 

In this next step, you\'ll set your Unlock Password for your current device. It\'s like a shortcut for proving ownership of your Keychain. 

Whenever you recover your account for the first time on a new device, you\'ll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.'** String get recoveryUnlockPasswordInstructionsSubtitle; + + /// No description provided for @recoverySuccessTitle. + /// + /// In en, this message translates to: + /// **'Congratulations your Catalyst 
Keychain is restored!'** + String get recoverySuccessTitle; + + /// No description provided for @recoverySuccessSubtitle. + /// + /// In en, this message translates to: + /// **'You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.'** + String get recoverySuccessSubtitle; + + /// No description provided for @recoverySuccessGoToDashboard. + /// + /// In en, this message translates to: + /// **'Jump into the Discovery space / Dashboard'** + String get recoverySuccessGoToDashboard; + + /// No description provided for @recoverySuccessGoAccount. + /// + /// In en, this message translates to: + /// **'Check my account'** + String get recoverySuccessGoAccount; + + /// No description provided for @recoveryExitConfirmDialogSubtitle. + /// + /// In en, this message translates to: + /// **'12 word keychain restoration incomplete'** + String get recoveryExitConfirmDialogSubtitle; + + /// No description provided for @recoveryExitConfirmDialogContent. + /// + /// In en, this message translates to: + /// **'Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.'** + String get recoveryExitConfirmDialogContent; + + /// No description provided for @recoveryExitConfirmDialogContinue. + /// + /// In en, this message translates to: + /// **'Continue recovery process'** + String get recoveryExitConfirmDialogContinue; } class _VoicesLocalizationsDelegate extends LocalizationsDelegate { diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart index 0d92ba67fc..b3457c1ea5 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart @@ -858,7 +858,7 @@ class VoicesLocalizationsEn extends VoicesLocalizations { String get registrationExitConfirmDialogContinue => 'Continue keychain creation'; @override - String get registrationExitConfirmDialogCancel => 'Cancel anyway'; + String get cancelAnyways => 'Cancel anyway'; @override String get recoverCatalystKeychain => 'Restore Catalyst keychain'; @@ -910,4 +910,25 @@ class VoicesLocalizationsEn extends VoicesLocalizations { @override String get recoveryUnlockPasswordInstructionsSubtitle => 'With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. 

But it can be a bit tedious to enter every single time you want to use the app. 

In this next step, you\'ll set your Unlock Password for your current device. It\'s like a shortcut for proving ownership of your Keychain. 

Whenever you recover your account for the first time on a new device, you\'ll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.'; + + @override + String get recoverySuccessTitle => 'Congratulations your Catalyst 
Keychain is restored!'; + + @override + String get recoverySuccessSubtitle => 'You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.'; + + @override + String get recoverySuccessGoToDashboard => 'Jump into the Discovery space / Dashboard'; + + @override + String get recoverySuccessGoAccount => 'Check my account'; + + @override + String get recoveryExitConfirmDialogSubtitle => '12 word keychain restoration incomplete'; + + @override + String get recoveryExitConfirmDialogContent => 'Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.'; + + @override + String get recoveryExitConfirmDialogContinue => 'Continue recovery process'; } diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart index fe098fea69..9c23eb5e9e 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart @@ -858,7 +858,7 @@ class VoicesLocalizationsEs extends VoicesLocalizations { String get registrationExitConfirmDialogContinue => 'Continue keychain creation'; @override - String get registrationExitConfirmDialogCancel => 'Cancel anyway'; + String get cancelAnyways => 'Cancel anyway'; @override String get recoverCatalystKeychain => 'Restore Catalyst keychain'; @@ -910,4 +910,25 @@ class VoicesLocalizationsEs extends VoicesLocalizations { @override String get recoveryUnlockPasswordInstructionsSubtitle => 'With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. 

But it can be a bit tedious to enter every single time you want to use the app. 

In this next step, you\'ll set your Unlock Password for your current device. It\'s like a shortcut for proving ownership of your Keychain. 

Whenever you recover your account for the first time on a new device, you\'ll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.'; + + @override + String get recoverySuccessTitle => 'Congratulations your Catalyst 
Keychain is restored!'; + + @override + String get recoverySuccessSubtitle => 'You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.'; + + @override + String get recoverySuccessGoToDashboard => 'Jump into the Discovery space / Dashboard'; + + @override + String get recoverySuccessGoAccount => 'Check my account'; + + @override + String get recoveryExitConfirmDialogSubtitle => '12 word keychain restoration incomplete'; + + @override + String get recoveryExitConfirmDialogContent => 'Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.'; + + @override + String get recoveryExitConfirmDialogContinue => 'Continue recovery process'; } diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb index 723ddae0cb..9d49d04bbc 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb @@ -890,7 +890,7 @@ "registrationExitConfirmDialogSubtitle": "Account creation incomplete!", "registrationExitConfirmDialogContent": "If attempt to leave without creating your keychain - account creation will be incomplete. \u2028\u2028You are not able to login without \u2028completing your keychain.", "registrationExitConfirmDialogContinue": "Continue keychain creation", - "registrationExitConfirmDialogCancel": "Cancel anyway", + "cancelAnyways": "Cancel anyway", "recoverCatalystKeychain": "Restore Catalyst keychain", "recoverKeychainMethodsTitle": "Restore your Catalyst Keychain", "recoverKeychainMethodsNoKeychainFound": "No Catalyst Keychain found on this device.", @@ -907,5 +907,12 @@ "recoveryAccountSuccessTitle": "Keychain recovered successfully!", "recoveryAccountDetailsAction": "Set unlock password for this device", "recoveryUnlockPasswordInstructionsTitle": "Set your Catalyst unlock password f\u2028or this device", - "recoveryUnlockPasswordInstructionsSubtitle": "With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. \u2028\u2028But it can be a bit tedious to enter every single time you want to use the app. \u2028\u2028In this next step, you'll set your Unlock Password for your current device. It's like a shortcut for proving ownership of your Keychain. \u2028\u2028Whenever you recover your account for the first time on a new device, you'll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access." + "recoveryUnlockPasswordInstructionsSubtitle": "With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. \u2028\u2028But it can be a bit tedious to enter every single time you want to use the app. \u2028\u2028In this next step, you'll set your Unlock Password for your current device. It's like a shortcut for proving ownership of your Keychain. \u2028\u2028Whenever you recover your account for the first time on a new device, you'll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.", + "recoverySuccessTitle": "Congratulations your Catalyst \u2028Keychain is restored!", + "recoverySuccessSubtitle": "You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.", + "recoverySuccessGoToDashboard": "Jump into the Discovery space / Dashboard", + "recoverySuccessGoAccount": "Check my account", + "recoveryExitConfirmDialogSubtitle": "12 word keychain restoration incomplete", + "recoveryExitConfirmDialogContent": "Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.", + "recoveryExitConfirmDialogContinue": "Continue recovery process" } \ No newline at end of file diff --git a/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart b/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart index c9157a9e68..bcdec7bfa8 100644 --- a/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart +++ b/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart @@ -7,6 +7,10 @@ import 'package:equatable/equatable.dart'; sealed class RegistrationStep extends Equatable { const RegistrationStep(); + bool get isRegistrationFlow => false; + + bool get isRecoverFlow => false; + @override List get props => []; } @@ -26,6 +30,9 @@ final class SeedPhraseRecoverStep extends RegistrationStep { this.stage = RecoverSeedPhraseStage.seedPhraseInstructions, }); + @override + bool get isRecoverFlow => true; + @override List get props => [stage]; } @@ -37,12 +44,18 @@ final class CreateKeychainStep extends RegistrationStep { this.stage = CreateKeychainStage.splash, }); + @override + bool get isRegistrationFlow => true; + @override List get props => [stage]; } final class FinishAccountCreationStep extends RegistrationStep { const FinishAccountCreationStep(); + + @override + bool get isRegistrationFlow => true; } final class WalletLinkStep extends RegistrationStep { @@ -52,6 +65,9 @@ final class WalletLinkStep extends RegistrationStep { this.stage = WalletLinkStage.intro, }); + @override + bool get isRegistrationFlow => true; + @override List get props => [stage]; }