1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

UX: Ensure multichain native token name is always shown (#19705)

* UX: Ensure multichain native token name is always shown

* Fix lint
This commit is contained in:
David Walsh 2023-06-26 12:54:32 -05:00 committed by GitHub
parent 3df690b852
commit 9a9625d96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ import {
getNativeCurrencyImage,
getDetectedTokensInCurrentNetwork,
getIstokenDetectionInactiveOnNonMainnetSupportedNetwork,
getTokenList,
} from '../../../selectors';
import { getNativeCurrency } from '../../../ducks/metamask/metamask';
import { useCurrencyDisplay } from '../../../hooks/useCurrencyDisplay';
@ -62,19 +61,15 @@ const AssetList = ({ onClickAsset }) => {
const primaryTokenImage = useSelector(getNativeCurrencyImage);
const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork) || [];
const istokenDetectionInactiveOnNonMainnetSupportedNetwork = useSelector(
const isTokenDetectionInactiveOnNonMainnetSupportedNetwork = useSelector(
getIstokenDetectionInactiveOnNonMainnetSupportedNetwork,
);
const tokenList = useSelector(getTokenList);
const tokenData = Object.values(tokenList).find(
(token) => token.symbol === primaryCurrencyProperties.suffix,
);
const title = tokenData?.name || primaryCurrencyProperties.suffix;
return (
<>
<TokenListItem
onClick={() => onClickAsset(nativeCurrency)}
title={title}
title={nativeCurrency}
primary={
primaryCurrencyProperties.value ?? secondaryCurrencyProperties.value
}
@ -96,7 +91,7 @@ const AssetList = ({ onClickAsset }) => {
}}
/>
{detectedTokens.length > 0 &&
!istokenDetectionInactiveOnNonMainnetSupportedNetwork ? (
!isTokenDetectionInactiveOnNonMainnetSupportedNetwork ? (
<DetectedTokensBanner
actionButtonOnClick={() => setShowDetectedTokens(true)}
margin={4}