Skip to content

Commit

Permalink
fix: zksync Currency logo path (#7491)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at 15ed405</samp>

### Summary
🌐💱🎨

<!--
1. 🌐 - This emoji represents the addition of a new chain or network,
which is what ZKSync is. It also conveys the idea of interoperability
and scalability, which are some of the benefits of using ZKSync.
2. 💱 - This emoji represents the concept of currency or token, which is
what the `CurrencyLogo` component is used for. It also suggests the idea
of swapping or transferring value across different chains or platforms,
which is another feature of ZKSync.
3. 🎨 - This emoji represents the visual aspect of the change, which is
adding a new logo image for the ZKSync chain. It also implies creativity
and design, which are involved in creating and displaying logos.
-->
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))
  • Loading branch information
Chef-Yogi authored Aug 4, 2023
1 parent 25d3cee commit 64d7cd0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/uikit/src/components/CurrencyLogo/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

2 comments on commit 64d7cd0

@vercel
Copy link

@vercel vercel bot commented on 64d7cd0 Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

uikit – ./packages/uikit

uikit.pancake.run
uikit-git-develop.pancake.run

@vercel
Copy link

@vercel vercel bot commented on 64d7cd0 Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.