mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +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:
parent
3df690b852
commit
9a9625d96c
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user