Skip to content
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
16 changes: 2 additions & 14 deletions mobile-app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions mobile-app/lib/l10n/app_id.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
10 changes: 2 additions & 8 deletions mobile-app/lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions mobile-app/lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
7 changes: 1 addition & 6 deletions mobile-app/lib/l10n/app_localizations_id.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
13 changes: 5 additions & 8 deletions mobile-app/lib/v2/screens/receive/receive_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,9 @@ class _ReceiveScreenState extends ConsumerState<ReceiveScreen> {
}
}

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
Expand Down Expand Up @@ -119,14 +116,12 @@ class _ReceiveScreenState extends ConsumerState<ReceiveScreen> {
}

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,
Expand All @@ -139,6 +134,8 @@ class _ReceiveScreenState extends ConsumerState<ReceiveScreen> {
),
],
);
} else {
content = ShareAccountButton(onTap: _share, isDisabled: isLoading);
}

return ScaffoldBaseBottomContent(child: content);
Expand Down
Loading