From ed45dfc64dae932b3396941015238b4df713ec56 Mon Sep 17 00:00:00 2001 From: Robert Schlittler Date: Fri, 25 Oct 2024 16:41:50 +0200 Subject: [PATCH] feat(frontend): change order of receive addresses according to testing-feedback, add text for eth --- .../receive/ReceiveAddresses.svelte | 96 ++++++++++--------- src/frontend/src/lib/i18n/en.json | 1 + src/frontend/src/lib/types/i18n.d.ts | 1 + 3 files changed, 54 insertions(+), 44 deletions(-) diff --git a/src/frontend/src/lib/components/receive/ReceiveAddresses.svelte b/src/frontend/src/lib/components/receive/ReceiveAddresses.svelte index aafbaf7d4d..41113a4cc5 100644 --- a/src/frontend/src/lib/components/receive/ReceiveAddresses.svelte +++ b/src/frontend/src/lib/components/receive/ReceiveAddresses.svelte @@ -10,10 +10,10 @@ import Hr from '$lib/components/ui/Hr.svelte'; import { LOCAL } from '$lib/constants/app.constants'; import { - RECEIVE_TOKENS_MODAL_ICRC_SECTION, - RECEIVE_TOKENS_MODAL_ICP_SECTION, + RECEIVE_TOKENS_MODAL_BTC_SECTION, RECEIVE_TOKENS_MODAL_ETH_SECTION, - RECEIVE_TOKENS_MODAL_BTC_SECTION + RECEIVE_TOKENS_MODAL_ICP_SECTION, + RECEIVE_TOKENS_MODAL_ICRC_SECTION } from '$lib/constants/test-ids.constants'; import { btcAddressMainnet, @@ -32,47 +32,6 @@ - - displayQRCode({ - address: $icrcAccountIdentifierText ?? '', - addressLabel: $i18n.receive.icp.text.principal, - addressToken: ICP_TOKEN - })} - address={$icrcAccountIdentifierText ?? ''} - token={ICP_TOKEN} - qrCodeAriaLabel={$i18n.receive.icp.text.display_internet_computer_principal_qr} - copyAriaLabel={$i18n.receive.icp.text.internet_computer_principal_copied} - testId={RECEIVE_TOKENS_MODAL_ICRC_SECTION} - > - {$i18n.receive.icp.text.principal} - - {$i18n.receive.icp.text.use_for_icrc_deposit} - - - - displayQRCode({ - address: $icpAccountIdentifierText ?? '', - addressLabel: $i18n.receive.icp.text.icp_account, - addressToken: ICP_TOKEN - })} - address={$icpAccountIdentifierText ?? ''} - token={ICP_TOKEN} - qrCodeAriaLabel={$i18n.receive.icp.text.display_icp_account_qr} - copyAriaLabel={$i18n.receive.icp.text.icp_account_copied} - testId={RECEIVE_TOKENS_MODAL_ICP_SECTION} - invisibleLogo - > - {$i18n.receive.icp.text.icp_account} - - {$i18n.receive.icp.text.use_for_icp_deposit} - - {#if NETWORK_BITCOIN_ENABLED}

@@ -148,6 +107,55 @@ testId={RECEIVE_TOKENS_MODAL_ETH_SECTION} > {$i18n.receive.ethereum.text.ethereum} + + {$i18n.receive.icp.text.your_private_eth_address} + + +
+
+
+ + + displayQRCode({ + address: $icrcAccountIdentifierText ?? '', + addressLabel: $i18n.receive.icp.text.principal, + addressToken: ICP_TOKEN + })} + address={$icrcAccountIdentifierText ?? ''} + token={ICP_TOKEN} + qrCodeAriaLabel={$i18n.receive.icp.text.display_internet_computer_principal_qr} + copyAriaLabel={$i18n.receive.icp.text.internet_computer_principal_copied} + testId={RECEIVE_TOKENS_MODAL_ICRC_SECTION} + > + {$i18n.receive.icp.text.principal} + + {$i18n.receive.icp.text.use_for_icrc_deposit} + + + + displayQRCode({ + address: $icpAccountIdentifierText ?? '', + addressLabel: $i18n.receive.icp.text.icp_account, + addressToken: ICP_TOKEN + })} + address={$icpAccountIdentifierText ?? ''} + token={ICP_TOKEN} + qrCodeAriaLabel={$i18n.receive.icp.text.display_icp_account_qr} + copyAriaLabel={$i18n.receive.icp.text.icp_account_copied} + testId={RECEIVE_TOKENS_MODAL_ICP_SECTION} + invisibleLogo + > + {$i18n.receive.icp.text.icp_account} + + {$i18n.receive.icp.text.use_for_icp_deposit} diff --git a/src/frontend/src/lib/i18n/en.json b/src/frontend/src/lib/i18n/en.json index 7002f2a021..67fa6b7d33 100644 --- a/src/frontend/src/lib/i18n/en.json +++ b/src/frontend/src/lib/i18n/en.json @@ -230,6 +230,7 @@ "use_for_all_tokens": "Use for all tokens when receiving from wallets, users, or other apps that support this address format.", "use_for_icrc_deposit": "Use for receiving ICRC-1 tokens in the ICP network, such as SNS, ck tokens, etc.", "use_for_icp_deposit": "Use for ICP deposits from exchanges or other wallets that only support Account IDs.", + "your_private_eth_address": "Your private address for all ERC20 tokens.", "display_account_id_qr": "Display ICP Account ID as a QR code", "account_id_copied": "ICP Account ID copied to clipboard.", "principal": "ICP Principal", diff --git a/src/frontend/src/lib/types/i18n.d.ts b/src/frontend/src/lib/types/i18n.d.ts index f125195ac1..5f2fb32877 100644 --- a/src/frontend/src/lib/types/i18n.d.ts +++ b/src/frontend/src/lib/types/i18n.d.ts @@ -201,6 +201,7 @@ interface I18nReceive { use_for_all_tokens: string; use_for_icrc_deposit: string; use_for_icp_deposit: string; + your_private_eth_address: string; display_account_id_qr: string; account_id_copied: string; principal: string;