-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: network box redesign #1893
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…e into network-box-redesign
…e into network-box-redesign
@@ -11,20 +11,25 @@ export function SafeImage(props: SafeImageProps) { | |||
const [validImageSrc, setValidImageSrc] = useState<false | string>(false) | |||
|
|||
useEffect(() => { | |||
let mounted = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to track this, otherwise there are side effects when changing networks and token logos not updating
const tokenLogoSrc = useMemo(() => { | ||
if (parentErc20Address) { | ||
return ( | ||
tokensFromLists[parentErc20Address]?.logoURI ?? | ||
tokensFromUser[parentErc20Address]?.logoURI | ||
) | ||
} | ||
|
||
return nativeCurrency.logoUrl | ||
}, [ | ||
nativeCurrency.logoUrl, | ||
parentErc20Address, | ||
tokensFromLists, | ||
tokensFromUser | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same code as in TokenButton.tsx
, can you reuse them please?
}) | ||
: undefined | ||
} | ||
symbolOverride={isCctpTransfer ? 'USDC.e' : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's CCTP, and it's withdrawal mode, the destination chain's (parent chain) symbol should be USDC, because the source chain (child chain) USDC would be the native USDC.
const symbol = useMemo(() => { | ||
if (symbolOverride) { | ||
return symbolOverride | ||
} | ||
|
||
if (parentErc20Address) { | ||
return ( | ||
tokensFromLists[parentErc20Address]?.symbol ?? | ||
tokensFromUser[parentErc20Address]?.symbol | ||
) | ||
} | ||
|
||
return nativeCurrency.symbol | ||
}, [ | ||
symbolOverride, | ||
nativeCurrency.symbol, | ||
parentErc20Address, | ||
tokensFromLists, | ||
tokensFromUser | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes FS-1012