verification before payment and email fixes
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pweb/providers/two_factor.dart';
|
||||
import 'package:pweb/utils/cooldown_format.dart';
|
||||
import 'package:pweb/widgets/resend_link.dart';
|
||||
|
||||
@@ -10,23 +7,33 @@ import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class ResendCodeButton extends StatelessWidget {
|
||||
const ResendCodeButton({super.key});
|
||||
final VoidCallback onPressed;
|
||||
final bool isCooldownActive;
|
||||
final bool isResending;
|
||||
final int cooldownRemainingSeconds;
|
||||
|
||||
const ResendCodeButton({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
required this.isCooldownActive,
|
||||
required this.isResending,
|
||||
required this.cooldownRemainingSeconds,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localizations = AppLocalizations.of(context)!;
|
||||
final provider = context.watch<TwoFactorProvider>();
|
||||
final isDisabled = provider.isCooldownActive || provider.isResending;
|
||||
final isDisabled = isCooldownActive || isResending;
|
||||
|
||||
final label = provider.isCooldownActive
|
||||
? '${localizations.twoFactorResend} (${formatCooldownSeconds(provider.cooldownRemainingSeconds)})'
|
||||
final label = isCooldownActive
|
||||
? '${localizations.twoFactorResend} (${formatCooldownSeconds(cooldownRemainingSeconds)})'
|
||||
: localizations.twoFactorResend;
|
||||
|
||||
return ResendLink(
|
||||
label: label,
|
||||
onPressed: provider.resendCode,
|
||||
onPressed: onPressed,
|
||||
isDisabled: isDisabled,
|
||||
isLoading: provider.isResending,
|
||||
isLoading: isResending,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user