-
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): role summary viewer (#924)
* feat(cat-voices): registration transaction summary * chore: cleanup localizations * refactor: apply bullet list * feat: add missing wallet link * feat: add missing wallet details * feat: add role chooser panel content * feat(cat-voices): add roles chooser * chore: revert * feat: add role summary screen * fix: background color * chore: update colors
- Loading branch information
Showing
21 changed files
with
247 additions
and
36 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
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
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
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
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
76 changes: 72 additions & 4 deletions
76
catalyst_voices/lib/pages/registration/wallet_link/stage/roles_summary_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 |
---|---|---|
@@ -1,12 +1,80 @@ | ||
import 'package:catalyst_voices/pages/registration/placeholder_panel.dart'; | ||
import 'package:catalyst_voices/pages/registration/registration_stage_message.dart'; | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; | ||
import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart'; | ||
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; | ||
import 'package:catalyst_voices_models/catalyst_voices_models.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
// TODO(dtscalac): define content | ||
class RolesSummaryPanel extends StatelessWidget { | ||
const RolesSummaryPanel({super.key}); | ||
final Set<AccountRole> defaultRoles; | ||
final Set<AccountRole> selectedRoles; | ||
|
||
const RolesSummaryPanel({ | ||
super.key, | ||
required this.defaultRoles, | ||
required this.selectedRoles, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
const SizedBox(height: 24), | ||
RegistrationStageMessage( | ||
title: Text(context.l10n.walletLinkRoleSummaryTitle), | ||
subtitle: _Subtitle(selectedRoles: selectedRoles), | ||
spacing: 12, | ||
), | ||
const SizedBox(height: 12), | ||
RolesSummaryContainer( | ||
selected: selectedRoles, | ||
lockedValuesAsDefault: defaultRoles, | ||
), | ||
const Spacer(), | ||
VoicesFilledButton( | ||
leading: VoicesAssets.icons.wallet.buildIcon(), | ||
onTap: () { | ||
RegistrationCubit.of(context).nextStep(); | ||
}, | ||
child: Text(context.l10n.walletLinkRoleSummaryButton), | ||
), | ||
const SizedBox(height: 10), | ||
VoicesTextButton( | ||
onTap: () { | ||
RegistrationCubit.of(context).changeRoleSetup(); | ||
}, | ||
child: Text(context.l10n.walletLinkTransactionChangeRoles), | ||
), | ||
], | ||
); | ||
} | ||
} | ||
|
||
class _Subtitle extends StatelessWidget { | ||
final Set<AccountRole> selectedRoles; | ||
|
||
const _Subtitle({required this.selectedRoles}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const PlaceholderPanel(); | ||
return Text.rich( | ||
TextSpan( | ||
children: [ | ||
TextSpan( | ||
text: context.l10n.walletLinkRoleSummaryContent1, | ||
), | ||
TextSpan( | ||
text: context.l10n | ||
.walletLinkRoleSummaryContent2(selectedRoles.length), | ||
style: const TextStyle(fontWeight: FontWeight.bold), | ||
), | ||
TextSpan( | ||
text: context.l10n.walletLinkRoleSummaryContent3, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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
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
6 changes: 6 additions & 0 deletions
6
catalyst_voices/packages/catalyst_voices_assets/lib/generated/colors.gen.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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.