From d374bdc66c0df8e72cf6c45adc0cf114fdfb1983 Mon Sep 17 00:00:00 2001 From: Arseni Date: Wed, 21 Jan 2026 18:12:32 +0300 Subject: [PATCH] Added popup for recipient deletion --- .../pweb/lib/app/router/payout_shell.dart | 24 +++++++++++++++++-- frontend/pweb/lib/l10n/en.arb | 4 ++++ frontend/pweb/lib/l10n/ru.arb | 4 ++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/frontend/pweb/lib/app/router/payout_shell.dart b/frontend/pweb/lib/app/router/payout_shell.dart index 18384c32..11e7a9b8 100644 --- a/frontend/pweb/lib/app/router/payout_shell.dart +++ b/frontend/pweb/lib/app/router/payout_shell.dart @@ -112,13 +112,33 @@ RouteBase payoutShellRoute() => ShellRoute( context, recipient: recipient, ), - onDeleteRecipient: (recipient) => executeActionWithNotification( + onDeleteRecipient: (recipient) async { + final confirmed = await showDialog( + context: context, + builder: (dialogContext) => AlertDialog( + title: Text(loc.delete), + content: Text(loc.deleteRecipientConfirmation), + actions: [ + TextButton( + onPressed: () => Navigator.pop(dialogContext, false), + child: Text(loc.cancel), + ), + ElevatedButton( + onPressed: () => Navigator.pop(dialogContext, true), + child: Text(loc.delete), + ), + ], + ), + ); + if (confirmed != true) return; + await executeActionWithNotification( context: context, action: () async => context.read().delete(recipient.id), successMessage: loc.recipientDeletedSuccessfully, errorMessage: loc.errorDeleteRecipient, - ), + ); + }, ), ); }, diff --git a/frontend/pweb/lib/l10n/en.arb b/frontend/pweb/lib/l10n/en.arb index ddae3047..9eee34dc 100644 --- a/frontend/pweb/lib/l10n/en.arb +++ b/frontend/pweb/lib/l10n/en.arb @@ -346,6 +346,10 @@ "@deletePaymentConfirmation": { "description": "Confirmation dialog message shown before a payment method is removed" }, + "deleteRecipientConfirmation": "Are you sure you want to delete this recipient?", + "@deleteRecipientConfirmation": { + "description": "Confirmation dialog message shown before a recipient is removed" + }, "edit": "Edit", "@edit": { diff --git a/frontend/pweb/lib/l10n/ru.arb b/frontend/pweb/lib/l10n/ru.arb index 69a031de..2341ddcf 100644 --- a/frontend/pweb/lib/l10n/ru.arb +++ b/frontend/pweb/lib/l10n/ru.arb @@ -346,6 +346,10 @@ "@deletePaymentConfirmation": { "description": "Сообщение диалога подтверждения, показываемое перед удалением способа оплаты" }, + "deleteRecipientConfirmation": "Вы уверены, что хотите удалить получателя?", + "@deleteRecipientConfirmation": { + "description": "Сообщение диалога подтверждения, показываемое перед удалением получателя" + }, "edit": "Редактировать", "@edit": { -- 2.49.1