From 0641b4e4c4c658cf493ca95c8d997d77e96d787f Mon Sep 17 00:00:00 2001 From: Phoebe Lartisant Date: Tue, 14 May 2024 18:17:33 +0200 Subject: [PATCH] add ms on confirmation screen --- web-frontend/src/i18n/en_US.json | 3 +- web-frontend/src/pages/Home/Home.tsx | 2 -- .../SendCoins/SendConfirmation.tsx | 36 ++++++++++++++----- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/web-frontend/src/i18n/en_US.json b/web-frontend/src/i18n/en_US.json index 53770134d..e33210d60 100644 --- a/web-frontend/src/i18n/en_US.json +++ b/web-frontend/src/i18n/en_US.json @@ -190,7 +190,8 @@ "failed-timeout": "Operation failed due to timeout, please retry with more fees." }, "mns": { - "mns-correlation": "MNS: {mns} correlates with the following address: {address}" + "mns-correlation": "MNS: {mns} correlates with the following address: {address}", + "mns": "MNS:" } }, "receive-coins": { diff --git a/web-frontend/src/pages/Home/Home.tsx b/web-frontend/src/pages/Home/Home.tsx index 0a2a2cb02..7dedb0d15 100644 --- a/web-frontend/src/pages/Home/Home.tsx +++ b/web-frontend/src/pages/Home/Home.tsx @@ -14,13 +14,11 @@ import { useNavigate, useParams } from 'react-router-dom'; import { Loading } from './Loading'; import { TAB_SEND, TAB_RECEIVE } from '@/const/tabs/tabs'; import { useResource } from '@/custom/api'; -// import { useMNS } from '@/custom/useMNS'; import { useMNS } from '@/custom/useMNS'; import Intl from '@/i18n/i18n'; import { WalletLayout, MenuItem } from '@/layouts/WalletLayout/WalletLayout'; import { AccountObject } from '@/models/AccountModel'; import { maskAddress, routeFor } from '@/utils'; -// import { useMNS } from '@/custom/useMNS'; export default function Home() { const navigate = useNavigate(); diff --git a/web-frontend/src/pages/TransferCoins/SendCoins/SendConfirmation.tsx b/web-frontend/src/pages/TransferCoins/SendCoins/SendConfirmation.tsx index 6a5b75d86..fd5ef8773 100644 --- a/web-frontend/src/pages/TransferCoins/SendCoins/SendConfirmation.tsx +++ b/web-frontend/src/pages/TransferCoins/SendCoins/SendConfirmation.tsx @@ -1,3 +1,5 @@ +import { useEffect } from 'react'; + import { Balance, Button, @@ -5,11 +7,13 @@ import { formatFTAmount, getAssetIcons, parseAmount, + Clipboard, } from '@massalabs/react-ui-kit'; import { FiChevronLeft } from 'react-icons/fi'; import { PRESET_HIGH, PRESET_LOW, PRESET_STANDARD } from './Advanced'; import { useFTTransfer } from '@/custom/smart-contract/useFTTransfer'; +import { useMNS } from '@/custom/useMNS'; import Intl from '@/i18n/i18n'; import { Asset } from '@/models/AssetModel'; import { maskAddress } from '@/utils'; @@ -50,6 +54,12 @@ export function SendConfirmation(props: SendConfirmationProps) { decimals, ).amountFormattedFull; + const { reverseResolveDns, mns } = useMNS(); + + useEffect(() => { + reverseResolveDns(); + }, [reverseResolveDns]); + let selectedFees; switch (fees) { @@ -90,12 +100,12 @@ export function SendConfirmation(props: SendConfirmationProps) {

{Intl.t('send-coins.send-message')}

-
-
+
+

{Intl.t('send-coins.fee')}

- {Intl.t('send-coins.recipient')} -

- {formattedRecipientAddress} -

+
{Intl.t('send-coins.recipient')}
+
+ {mns && ( +
+
{Intl.t('send-coins.mns.mns')}
+
{mns}
+
+ )}