diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index ecaedb3201d0..5f6a977c1cf4 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -870,6 +870,9 @@ "bridgeDontSend": { "message": "Bridge, don't send" }, + "bridgeSelectNetwork": { + "message": "Select network" + }, "browserNotSupported": { "message": "Your browser is not supported..." }, diff --git a/test/e2e/tests/multichain/asset-picker-send.spec.ts b/test/e2e/tests/multichain/asset-picker-send.spec.ts index 5accb14c6074..a071bec9426d 100644 --- a/test/e2e/tests/multichain/asset-picker-send.spec.ts +++ b/test/e2e/tests/multichain/asset-picker-send.spec.ts @@ -71,7 +71,7 @@ describe('AssetPickerSendFlow @no-mmi', function () { ) ).getText(); - assert.equal(tokenListValue, '25 ETH'); + assert.equal(tokenListValue, '$250,000.00'); const tokenListSecondaryValue = await ( await driver.findElement( @@ -79,7 +79,7 @@ describe('AssetPickerSendFlow @no-mmi', function () { ) ).getText(); - assert.equal(tokenListSecondaryValue, '$250,000.00'); + assert.equal(tokenListSecondaryValue, '25 ETH'); // Search for CHZ const searchInputField = await driver.waitForSelector( diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.test.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.test.tsx index f35bc8196724..0b641101c5dd 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.test.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.test.tsx @@ -77,10 +77,11 @@ describe('Asset', () => { expect.objectContaining({ tokenSymbol: 'WETH', tokenImage: 'token-icon-url', - primary: '10', - secondary: '$10.10', + primary: '$10.10', + secondary: '10 WETH', title: 'Token', tooltipText: 'tooltip', + isPrimaryTokenSymbolHidden: true, }), {}, ); diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.tsx index 83229689f055..f384ef8fd96f 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/Asset.tsx @@ -40,18 +40,22 @@ export default function Asset({ {}, true, ); + const formattedAmount = decimalTokenAmount + ? `${formatAmount( + locale, + new BigNumber(decimalTokenAmount || '0', 10), + )} ${symbol}` + : undefined; return ( ); } diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx index 9061592cf37c..fa071740b51d 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx @@ -1,10 +1,11 @@ import React from 'react'; import { useSelector } from 'react-redux'; import classnames from 'classnames'; -import { getSelectedAccountCachedBalance } from '../../../../selectors'; +import { + getCurrentCurrency, + getSelectedAccountCachedBalance, +} from '../../../../selectors'; import { getNativeCurrency } from '../../../../ducks/metamask/metamask'; -import { useUserPreferencedCurrency } from '../../../../hooks/useUserPreferencedCurrency'; -import { PRIMARY, SECONDARY } from '../../../../helpers/constants/common'; import { useCurrencyDisplay } from '../../../../hooks/useCurrencyDisplay'; import { AssetType } from '../../../../../shared/constants/transaction'; import { Box } from '../../../component-library'; @@ -43,28 +44,16 @@ export default function AssetList({ const nativeCurrency = useSelector(getNativeCurrency); const balanceValue = useSelector(getSelectedAccountCachedBalance); + const currentCurrency = useSelector(getCurrentCurrency); - const { - currency: primaryCurrency, - numberOfDecimals: primaryNumberOfDecimals, - } = useUserPreferencedCurrency(PRIMARY, { ethNumberOfDecimals: 4 }); - - const { - currency: secondaryCurrency, - numberOfDecimals: secondaryNumberOfDecimals, - } = useUserPreferencedCurrency(SECONDARY, { ethNumberOfDecimals: 4 }); - - const [, primaryCurrencyProperties] = useCurrencyDisplay(balanceValue, { - numberOfDecimals: primaryNumberOfDecimals, - currency: primaryCurrency, + const [primaryCurrencyValue] = useCurrencyDisplay(balanceValue, { + currency: currentCurrency, + hideLabel: true, }); - const [secondaryCurrencyDisplay, secondaryCurrencyProperties] = - useCurrencyDisplay(balanceValue, { - numberOfDecimals: secondaryNumberOfDecimals, - currency: secondaryCurrency, - hideLabel: true, - }); + const [secondaryCurrencyValue] = useCurrencyDisplay(balanceValue, { + currency: nativeCurrency, + }); return ( @@ -72,6 +61,7 @@ export default function AssetList({ const tokenAddress = token.address?.toLowerCase(); const isSelected = tokenAddress === selectedToken?.toLowerCase(); const isDisabled = isTokenDisabled?.(token) ?? false; + return ( {token.type === AssetType.native ? ( ) : ( +
+
+
+