Skip to content

Commit

Permalink
fix: improve 2fa delete input step padding
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-ajax committed Jan 2, 2025
1 parent 9c6ff28 commit 89dbab4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DeleteAuthenticatorInputStep extends ConsumerWidget {
headerTitle: locale.authenticator_delete_title,
headerDescription: locale.authenticator_delete_description,
headerIcon: Assets.svg.iconWalletProtectFill.icon(size: 36.0.s),
contentPadding: 8.0.s,
child: DeleteTwoFAInputStep(
twoFaToDelete: TwoFaType.auth,
onDeleteSuccess: () => AuthenticatorDeleteSuccessRoute().push<void>(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,38 @@ class DeleteTwoFAInputStep extends HookConsumerWidget {
key: formKey.value,
child: CustomScrollView(
slivers: [
SliverList.builder(
itemCount: twoFaTypes.length,
itemBuilder: (context, index) {
final twoFaType = twoFaTypes[index];
return Padding(
padding: EdgeInsets.only(bottom: 22.0.s),
child: TwoFaCodeInput(
controller: controllers[twoFaType]!,
twoFaType: twoFaType,
onRequestCode: () async {
await guardPasskeyDialog(
ref.context,
(child) => RiverpodVerifyIdentityRequestBuilder(
provider: requestTwoFaCodeNotifierProvider,
requestWithVerifyIdentity:
(OnVerifyIdentity<GenerateSignatureResponse> onVerifyIdentity) {
ref.read(requestTwoFaCodeNotifierProvider.notifier).requestTwoFaCode(
twoFaType,
onVerifyIdentity,
);
},
child: child,
),
);
},
isSending: isRequesting,
),
);
},
SliverPadding(
padding: EdgeInsets.only(top: 56.0.s),
sliver: SliverList.builder(
itemCount: twoFaTypes.length,
itemBuilder: (context, index) {
final twoFaType = twoFaTypes[index];
return Padding(
padding: EdgeInsets.only(bottom: 22.0.s),
child: TwoFaCodeInput(
controller: controllers[twoFaType]!,
twoFaType: twoFaType,
onRequestCode: () async {
await guardPasskeyDialog(
ref.context,
(child) => RiverpodVerifyIdentityRequestBuilder(
provider: requestTwoFaCodeNotifierProvider,
requestWithVerifyIdentity:
(OnVerifyIdentity<GenerateSignatureResponse> onVerifyIdentity) {
ref.read(requestTwoFaCodeNotifierProvider.notifier).requestTwoFaCode(
twoFaType,
onVerifyIdentity,
);
},
child: child,
),
);
},
isSending: isRequesting,
),
);
},
),
),
SliverFillRemaining(
hasScrollBody: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ class DeleteTwoFAStepScaffold extends ConsumerWidget {
required this.headerDescription,
required this.headerIcon,
required this.child,
this.contentPadding,
super.key,
});

final String headerTitle;
final String headerDescription;
final Widget headerIcon;
final Widget child;
final double? contentPadding;

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand All @@ -46,7 +48,7 @@ class DeleteTwoFAStepScaffold extends ConsumerWidget {
description: headerDescription,
icon: AuthHeaderIcon(icon: headerIcon),
),
SizedBox(height: 64.0.s),
SizedBox(height: contentPadding ?? 64.0.s),
Expanded(child: child),
],
),
Expand Down

0 comments on commit 89dbab4

Please sign in to comment.