Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve 2fa delete input step padding #497

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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