✨ Unactivated account hint, close #199
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:island/models/account.dart';
|
||||
import 'package:island/models/wallet.dart';
|
||||
import 'package:island/pods/network.dart';
|
||||
import 'package:island/widgets/alert.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
|
||||
@@ -428,3 +431,47 @@ class VerificationStatusCard extends StatelessWidget {
|
||||
).padding(horizontal: 24, vertical: 16);
|
||||
}
|
||||
}
|
||||
|
||||
class AccountUnactivatedCard extends HookConsumerWidget {
|
||||
const AccountUnactivatedCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Card(
|
||||
margin: EdgeInsets.zero,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
Symbols.warning_amber_rounded,
|
||||
size: 40,
|
||||
fill: 1,
|
||||
color: Colors.amber,
|
||||
),
|
||||
const Gap(4),
|
||||
Text('accountActivationAlert').tr().fontSize(16).bold(),
|
||||
Text('accountActivationAlertHint').tr(),
|
||||
const Gap(4),
|
||||
Text('accountActivationResendHint').tr().opacity(0.8),
|
||||
const Gap(16),
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Symbols.email),
|
||||
label: Text('accountActivationResend').tr(),
|
||||
onPressed: () async {
|
||||
final client = ref.watch(apiClientProvider);
|
||||
try {
|
||||
showLoadingModal(context);
|
||||
await client.post('/pass/spells/activation/resend');
|
||||
showSnackBar("Activation magic spell has been resend");
|
||||
} catch (err) {
|
||||
showErrorAlert(err);
|
||||
} finally {
|
||||
if (context.mounted) hideLoadingModal(context);
|
||||
}
|
||||
},
|
||||
).width(double.infinity),
|
||||
],
|
||||
).padding(horizontal: 24, vertical: 16),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user