From 1e0d7707d29b2d395e80cce24c682ebe2fab75a7 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Thu, 16 Mar 2023 12:52:26 +0200 Subject: [PATCH] Render wallet plate image/text parts --- .../create-wallet/AddWalletDetailsStep.js | 23 ++++++++---- .../create-wallet/WalletChecksumTipsDialog.js | 36 ++++++++++++++----- .../app/i18n/locales/en-US.json | 4 +-- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/packages/yoroi-extension/app/components/wallet/create-wallet/AddWalletDetailsStep.js b/packages/yoroi-extension/app/components/wallet/create-wallet/AddWalletDetailsStep.js index ea99cfbfd9..3fd844c6a3 100644 --- a/packages/yoroi-extension/app/components/wallet/create-wallet/AddWalletDetailsStep.js +++ b/packages/yoroi-extension/app/components/wallet/create-wallet/AddWalletDetailsStep.js @@ -22,6 +22,7 @@ import { HARD_DERIVATION_START } from '../../../config/numbersConfig'; import { NUMBER_OF_VERIFIED_ADDRESSES } from '../../../stores/toplevel/WalletRestoreStore'; import { networks } from '../../../api/ada/lib/storage/database/prepackaged/networks'; import WalletAccountIcon from '../../topbar/WalletAccountIcon'; +import WalletChecksumTipsDialog from './WalletChecksumTipsDialog'; const messages: * = defineMessages({ description: { @@ -139,6 +140,15 @@ export default class AddWalletDetailsStep extends Component { Number.parseInt(network.BaseConfig[0].ChainNetworkId, 10) ); + const plateImagePart = ( + + ); + return ( @@ -192,12 +202,7 @@ export default class AddWalletDetailsStep extends Component { mt='-3px' mb='90px' > - + {plateImagePart} {plate.TextPart} @@ -220,7 +225,11 @@ export default class AddWalletDetailsStep extends Component { open={shouldShowDialog} onClose={hideDialog} /> - + ); } diff --git a/packages/yoroi-extension/app/components/wallet/create-wallet/WalletChecksumTipsDialog.js b/packages/yoroi-extension/app/components/wallet/create-wallet/WalletChecksumTipsDialog.js index ad212c96f0..420ff3f625 100644 --- a/packages/yoroi-extension/app/components/wallet/create-wallet/WalletChecksumTipsDialog.js +++ b/packages/yoroi-extension/app/components/wallet/create-wallet/WalletChecksumTipsDialog.js @@ -2,7 +2,7 @@ import type { Node, ComponentType } from 'react'; import InfoDialog from '../../widgets/infoDialog'; import type { $npm$ReactIntl$IntlShape } from 'react-intl'; -import { defineMessages, injectIntl } from 'react-intl'; +import { defineMessages, injectIntl, FormattedMessage, FormattedHTMLMessage } from 'react-intl'; import { Typography, Box } from '@mui/material'; const messages: Object = defineMessages({ @@ -11,12 +11,12 @@ const messages: Object = defineMessages({ defaultMessage: '!!!What is wallet checksum and plate number?', }, firstTip: { - id: 'wallet.create.dialog.walletChecksum.firstTip', - defaultMessage: '!!!Wallet checksum is a generic Blockie image that is generated to visually distinguish your wallet from others.', + id: 'wallet.create.dialog.walletChecksum.firstTip', // todo: update it + defaultMessage: '!!!{plateImg} Wallet checksum is a generic Blockie image that is generated to visually distinguish your wallet from others.', }, secondTip: { id: 'wallet.create.dialog.walletChecksum.secondTip', - defaultMessage: '!!!Plate number {plateNumber} is a auto-generated sign of four letters and four digits.', + defaultMessage: '!!!Plate number {plateText} is a auto-generated sign of four letters and four digits.', }, thirdTip: { id: 'wallet.create.dialog.walletChecksum.thirdTip', @@ -34,20 +34,40 @@ type Props = {| |} function walletChecksumTipsDialog(props: Props & Intl): Node { - const { open, onClose, intl } = props; + const { open, onClose, intl, plateImagePart, plateTextPart } = props; return ( {intl.formatMessage(messages.title)} - {intl.formatMessage(messages.firstTip)} + + + + {plateImagePart} + + + ) + }} + /> + - {intl.formatMessage(messages.secondTip)} + + + - {intl.formatMessage(messages.thirdTip)} + + {intl.formatMessage(messages.thirdTip)} + diff --git a/packages/yoroi-extension/app/i18n/locales/en-US.json b/packages/yoroi-extension/app/i18n/locales/en-US.json index 1805985e6b..6ac7c523b9 100644 --- a/packages/yoroi-extension/app/i18n/locales/en-US.json +++ b/packages/yoroi-extension/app/i18n/locales/en-US.json @@ -474,8 +474,8 @@ "wallet.create.dialog.walletNameAndPassword.whatIsWalletPassword.firstTip": "Password is an additional security layer used to confirm transactions from this device", "wallet.create.dialog.walletNameAndPassword.whatIsWalletPassword.secondTip": "Both wallet name and password are stored locally, so you are only person who can change or restore it.", "wallet.create.dialog.walletChecksum.title": "What is wallet checksum and plate number?", - "wallet.create.dialog.walletChecksum.firstTip": "Wallet checksum is a generic Blockie image that is generated to visually distinguish your wallet from others.", - "wallet.create.dialog.walletChecksum.secondTip": "Plate number {plateNumber} is a auto-generated sign of four letters and four digits.", + "wallet.create.dialog.walletChecksum.firstTip": "{plateImg} Wallet checksum is a generic Blockie image that is generated to visually distinguish your wallet from others.", + "wallet.create.dialog.walletChecksum.secondTip": "Plate number {plateText} is a auto-generated sign of four letters and four digits.", "wallet.create.dialog.walletChecksum.thirdTip": "Checksum and plate number are unique to your wallet and represent your public key.", "wallet.add.page.revamp.subtitle": "Light wallet for Cardano assets", "wallet.add.page.revamp.createWallet": "Create new wallet",