-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cat-voices): account restored (#997)
* feat: account restored panel * docs: check local keychains * feat: exit dialog
- Loading branch information
1 parent
f7de3d2
commit ba12cd3
Showing
14 changed files
with
315 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.