From 160faaacbcc83d59e7a0463f86096c78cb4433ad Mon Sep 17 00:00:00 2001 From: Nikolaus Heger Date: Tue, 23 Jun 2026 16:00:53 +0800 Subject: [PATCH] Fix the button layout on receive Adds the copy button back - it was flipped vs the design, which made me complain about it to the designer --- mobile-app/lib/l10n/app_en.arb | 16 ++-------------- mobile-app/lib/l10n/app_id.arb | 3 +-- mobile-app/lib/l10n/app_localizations.dart | 10 ++-------- mobile-app/lib/l10n/app_localizations_en.dart | 7 +------ mobile-app/lib/l10n/app_localizations_id.dart | 7 +------ .../lib/v2/screens/receive/receive_screen.dart | 13 +++++-------- 6 files changed, 12 insertions(+), 44 deletions(-) diff --git a/mobile-app/lib/l10n/app_en.arb b/mobile-app/lib/l10n/app_en.arb index 31c5b3f4..af37d696 100644 --- a/mobile-app/lib/l10n/app_en.arb +++ b/mobile-app/lib/l10n/app_en.arb @@ -1706,21 +1706,9 @@ } } }, - "receiveClipboardContent": "Account Id:\n{accountId}\n\nCheckphrase:\n{checksum}", - "@receiveClipboardContent": { - "description": "Clipboard content when copying account details", - "placeholders": { - "accountId": { - "type": "String" - }, - "checksum": { - "type": "String" - } - } - }, - "receiveCopiedMessage": "Account details copied to clipboard", + "receiveCopiedMessage": "Address copied to clipboard", "@receiveCopiedMessage": { - "description": "Toast when account details are copied" + "description": "Toast when the address is copied" }, "posAmountTitle": "New Charge", diff --git a/mobile-app/lib/l10n/app_id.arb b/mobile-app/lib/l10n/app_id.arb index 546ba2d5..cc136cf8 100644 --- a/mobile-app/lib/l10n/app_id.arb +++ b/mobile-app/lib/l10n/app_id.arb @@ -387,8 +387,7 @@ "receiveTabAddress": "Alamat", "receiveCopy": "Salin", "receiveErrorLoadingAccount": "Gagal memuat data akun: {error}", - "receiveClipboardContent": "ID Akun:\n{accountId}\n\nCheckphrase:\n{checksum}", - "receiveCopiedMessage": "Detail akun disalin ke clipboard", + "receiveCopiedMessage": "Alamat disalin ke clipboard", "posAmountTitle": "Tagihan Baru", "posAmountCharge": "Tagih {amount}", diff --git a/mobile-app/lib/l10n/app_localizations.dart b/mobile-app/lib/l10n/app_localizations.dart index 1cad424b..6561199c 100644 --- a/mobile-app/lib/l10n/app_localizations.dart +++ b/mobile-app/lib/l10n/app_localizations.dart @@ -2258,16 +2258,10 @@ abstract class AppLocalizations { /// **'Error loading account data: {error}'** String receiveErrorLoadingAccount(String error); - /// Clipboard content when copying account details + /// Toast when the address is copied /// /// In en, this message translates to: - /// **'Account Id:\n{accountId}\n\nCheckphrase:\n{checksum}'** - String receiveClipboardContent(String accountId, String checksum); - - /// Toast when account details are copied - /// - /// In en, this message translates to: - /// **'Account details copied to clipboard'** + /// **'Address copied to clipboard'** String get receiveCopiedMessage; /// App bar title on POS amount screen diff --git a/mobile-app/lib/l10n/app_localizations_en.dart b/mobile-app/lib/l10n/app_localizations_en.dart index 3d68a3d3..f4274950 100644 --- a/mobile-app/lib/l10n/app_localizations_en.dart +++ b/mobile-app/lib/l10n/app_localizations_en.dart @@ -1187,12 +1187,7 @@ class AppLocalizationsEn extends AppLocalizations { } @override - String receiveClipboardContent(String accountId, String checksum) { - return 'Account Id:\n$accountId\n\nCheckphrase:\n$checksum'; - } - - @override - String get receiveCopiedMessage => 'Account details copied to clipboard'; + String get receiveCopiedMessage => 'Address copied to clipboard'; @override String get posAmountTitle => 'New Charge'; diff --git a/mobile-app/lib/l10n/app_localizations_id.dart b/mobile-app/lib/l10n/app_localizations_id.dart index c00f1270..ed0a95ef 100644 --- a/mobile-app/lib/l10n/app_localizations_id.dart +++ b/mobile-app/lib/l10n/app_localizations_id.dart @@ -1190,12 +1190,7 @@ class AppLocalizationsId extends AppLocalizations { } @override - String receiveClipboardContent(String accountId, String checksum) { - return 'ID Akun:\n$accountId\n\nCheckphrase:\n$checksum'; - } - - @override - String get receiveCopiedMessage => 'Detail akun disalin ke clipboard'; + String get receiveCopiedMessage => 'Alamat disalin ke clipboard'; @override String get posAmountTitle => 'Tagihan Baru'; diff --git a/mobile-app/lib/v2/screens/receive/receive_screen.dart b/mobile-app/lib/v2/screens/receive/receive_screen.dart index 4bf175a3..24e25b26 100644 --- a/mobile-app/lib/v2/screens/receive/receive_screen.dart +++ b/mobile-app/lib/v2/screens/receive/receive_screen.dart @@ -67,12 +67,9 @@ class _ReceiveScreenState extends ConsumerState { } } - void _copyAccountDetails(BuildContext context) { + void _copyAddress(BuildContext context) { final l10n = ref.read(l10nProvider); - context.copyTextWithToaster( - l10n.receiveClipboardContent(_accountId!, _checksum!), - message: l10n.receiveCopiedMessage, - ); + context.copyTextWithToaster(_accountId!, message: l10n.receiveCopiedMessage); } @override @@ -119,14 +116,12 @@ class _ReceiveScreenState extends ConsumerState { } if (_selectedTab == ReceiveTab.qrCode) { - content = ShareAccountButton(onTap: _share, isDisabled: isLoading); - } else { content = Row( children: [ Expanded( child: QuantusButton.simple( label: l10n.receiveCopy, - onTap: () => _copyAccountDetails(context), + onTap: () => _copyAddress(context), isDisabled: isLoading, icon: Icon(Icons.copy, size: 20, color: context.colors.textPrimary), iconPlacement: IconPlacement.leading, @@ -139,6 +134,8 @@ class _ReceiveScreenState extends ConsumerState { ), ], ); + } else { + content = ShareAccountButton(onTap: _share, isDisabled: isLoading); } return ScaffoldBaseBottomContent(child: content);