From 64d7cd0801bae7a0876744cd33d841dcdf6dd9f1 Mon Sep 17 00:00:00 2001 From: Chef Yogi <99634186+Chef-Yogi@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:41:41 +0800 Subject: [PATCH] fix: zksync Currency logo path (#7491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### 🤖 Generated by Copilot at 15ed405 ### Summary 🌐💱🎨 Add ZKSync chain support to `CurrencyLogo` component. Update `utils.ts` with ZKSync chain ID and logo URI. > _Oh we're the savvy sailors of the ZKSync chain_ > _We show our `CurrencyLogo` with pride and not in vain_ > _We heave and ho and update our `utils.ts`_ > _We're the fastest and the cheapest and we put it to the test_ ### Walkthrough * Add support for ZKSync chain and currency logos ([link](https://github.com/pancakeswap/pancake-frontend/pull/7491/files?diff=unified&w=0#diff-7deb472f34cafe26dd54d7936b6e694673570a38a9cc6694b511062b1e8b01d9R10), [link](https://github.com/pancakeswap/pancake-frontend/pull/7491/files?diff=unified&w=0#diff-7deb472f34cafe26dd54d7936b6e694673570a38a9cc6694b511062b1e8b01d9R42)) * Map ZKSync chain ID to its name in `CHAIN_ID_NAMES` object ([link](https://github.com/pancakeswap/pancake-frontend/pull/7491/files?diff=unified&w=0#diff-7deb472f34cafe26dd54d7936b6e694673570a38a9cc6694b511062b1e8b01d9R10)) * Use Ethereum logo URI for ZKSync chain in `LOGO_URI_BY_CHAIN_ID` object ([link](https://github.com/pancakeswap/pancake-frontend/pull/7491/files?diff=unified&w=0#diff-7deb472f34cafe26dd54d7936b6e694673570a38a9cc6694b511062b1e8b01d9R42)) * Update `utils.ts` file in `CurrencyLogo` component ([link](https://github.com/pancakeswap/pancake-frontend/pull/7491/files?diff=unified&w=0#diff-7deb472f34cafe26dd54d7936b6e694673570a38a9cc6694b511062b1e8b01d9R10), [link](https://github.com/pancakeswap/pancake-frontend/pull/7491/files?diff=unified&w=0#diff-7deb472f34cafe26dd54d7936b6e694673570a38a9cc6694b511062b1e8b01d9R42)) --- packages/uikit/src/components/CurrencyLogo/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/uikit/src/components/CurrencyLogo/utils.ts b/packages/uikit/src/components/CurrencyLogo/utils.ts index 72696852098c8..e1dff7762026d 100644 --- a/packages/uikit/src/components/CurrencyLogo/utils.ts +++ b/packages/uikit/src/components/CurrencyLogo/utils.ts @@ -7,6 +7,7 @@ const mapping: { [key: number]: string } = { [ChainId.ETHEREUM]: "ethereum", [ChainId.POLYGON_ZKEVM]: "polygonzkevm", [ChainId.ARBITRUM_ONE]: "arbitrum", + [ChainId.ZKSYNC]: "zksync", }; export const getTokenLogoURL = memoize( @@ -38,6 +39,7 @@ const chainName: { [key: number]: string } = { [ChainId.ETHEREUM]: "eth", [ChainId.POLYGON_ZKEVM]: "polygon-zkevm", [ChainId.ARBITRUM_ONE]: "arb", + [ChainId.ZKSYNC]: "zksync", }; // TODO: move to utils or token-list