diff --git a/packages/neuron-ui/src/components/Receive/index.tsx b/packages/neuron-ui/src/components/Receive/index.tsx index 9c99c7cd8b..4ff1032878 100644 --- a/packages/neuron-ui/src/components/Receive/index.tsx +++ b/packages/neuron-ui/src/components/Receive/index.tsx @@ -1,7 +1,7 @@ import React, { useState, useCallback, useMemo } from 'react' import { RouteComponentProps } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { Stack, Text, TextField, TooltipHost, Modal, FontSizes, IconButton } from 'office-ui-fabric-react' +import { Stack, Text, TextField, TooltipHost, Modal, IconButton } from 'office-ui-fabric-react' import { StateWithDispatch } from 'states/stateProvider/reducer' import QRCode from 'widgets/QRCode' @@ -28,35 +28,43 @@ const Receive = ({ addPopup('addr-copied')(dispatch) }, [accountAddress, dispatch]) + const Address = useMemo( + () => ( + + + + + + + + + ), + [copyAddress, accountAddress, t] + ) + if (!accountAddress) { return
{t('receive.address-not-found')}
} return ( <> - - - - - - - - - - + + + {`${t('receive.address', { network: accountAddress.startsWith('ckb') ? 'CKB Mainnet' : 'CKB Testnet' })}`} + + + {t('receive.prompt')} + setShowLargeQRCode(false)}> diff --git a/packages/neuron-ui/src/locales/en.json b/packages/neuron-ui/src/locales/en.json index 4dbcb0152f..679aaad4de 100644 --- a/packages/neuron-ui/src/locales/en.json +++ b/packages/neuron-ui/src/locales/en.json @@ -106,7 +106,8 @@ "click-to-copy": "Click to copy the address", "address-not-found": "Address not found", "prompt": "Neuron picks a new receiving address for better privacy. Please go to the Address Book if you want to use a previously used receiving address.", - "address-qrcode": "Address QR Code" + "address-qrcode": "Address QR Code", + "address": "{{network}} Address" }, "history": { "meta": "Meta", diff --git a/packages/neuron-ui/src/locales/zh.json b/packages/neuron-ui/src/locales/zh.json index c8dd4d46f7..05e9e488b4 100644 --- a/packages/neuron-ui/src/locales/zh.json +++ b/packages/neuron-ui/src/locales/zh.json @@ -106,7 +106,8 @@ "click-to-copy": "点击复制地址", "address-not-found": "未找到地址", "prompt": "为了保护隐私,Neuron 会自动选择一个新收款地址。如果您想使用旧的收款地址,请访问地址管理页面。", - "address-qrcode": "地址二维码" + "address-qrcode": "地址二维码", + "address": "{{network}} 地址" }, "history": { "meta": "元信息", diff --git a/packages/neuron-ui/src/widgets/QRCode/index.tsx b/packages/neuron-ui/src/widgets/QRCode/index.tsx index af5ce69a19..7ef814096d 100644 --- a/packages/neuron-ui/src/widgets/QRCode/index.tsx +++ b/packages/neuron-ui/src/widgets/QRCode/index.tsx @@ -82,6 +82,7 @@ const QRCode = ({ includeMargin = false, exportable = false, dispatch, + remark, }: { value: string size: number @@ -93,6 +94,7 @@ const QRCode = ({ includeMargin?: boolean exportable?: boolean dispatch: StateDispatch + remark?: JSX.Element }) => { const [t] = useTranslation() const qrcode = new QRCodeImpl(-1, level) @@ -156,8 +158,9 @@ const QRCode = ({ + {remark || null} {exportable ? ( - + {t('qrcode.copy')} {t('qrcode.save')}