1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

updated linea image for token and badge (#19717)

* updated linea image for token and badge

* replaced hardcoded string with constant
This commit is contained in:
Nidhi Kumari 2023-06-26 22:07:20 +05:30 committed by GitHub
parent 48f61dcf61
commit e9423be894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@ import {
MetaMetricsEventCategory,
MetaMetricsEventName,
} from '../../../../shared/constants/metametrics';
import { LINEA_GOERLI_TOKEN_IMAGE_URL } from '../../../../shared/constants/network';
export const TokenListItem = ({
className,
@ -44,6 +45,10 @@ export const TokenListItem = ({
const dataTheme = document.documentElement.getAttribute('data-theme');
const trackEvent = useContext(MetaMetricsContext);
const chainId = useSelector(getCurrentChainId);
const badgeWrapperImage =
title === 'LineaETH' ? LINEA_GOERLI_TOKEN_IMAGE_URL : primaryTokenImage;
const badgeTokenImage =
title === 'LineaETH' ? LINEA_GOERLI_TOKEN_IMAGE_URL : tokenImage;
return (
<Box
@ -80,9 +85,9 @@ export const TokenListItem = ({
<AvatarNetwork
size={Size.XS}
name={tokenSymbol}
src={primaryTokenImage}
src={badgeWrapperImage}
borderColor={
primaryTokenImage
badgeWrapperImage
? BorderColor.borderMuted
: BorderColor.borderDefault
}
@ -92,10 +97,12 @@ export const TokenListItem = ({
>
<AvatarToken
name={tokenSymbol}
src={tokenImage}
src={badgeTokenImage}
showHalo
borderColor={
tokenImage ? BorderColor.transparent : BorderColor.borderDefault
badgeTokenImage
? BorderColor.transparent
: BorderColor.borderDefault
}
/>
</BadgeWrapper>