Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Update xdai and wxdai token logo (#2122)
Browse files Browse the repository at this point in the history
# Summary

Fixes #1179 
Before:
![image](https://user-images.githubusercontent.com/622217/149204240-1c9f6279-d524-42e0-9269-4d60ff8a4be4.png)
After:
![image](https://user-images.githubusercontent.com/622217/149204282-281b531d-4b83-4651-8240-341e051ff770.png)


  # To Test

1. Open the page [`swap`](https://pr2122--gpswapui.review.gnosisdev.com/)
2. Connect a wallet while on xDai network
3. Pick xDai and wxDai
4. Check the token logos. Should look like the screenshot above.
  • Loading branch information
alongoni authored Jan 13, 2022
1 parent 4b174aa commit ddf8ca6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Binary file added src/assets/images/wxdai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/xdai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/custom/components/CurrencyLogo/CurrencyLogoMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useMemo } from 'react'
import styled from 'styled-components/macro'

import EthereumLogo from 'assets/images/ethereum-logo.png'
import xDaiLogo from 'assets/images/xdai.png'
import useHttpLocations from 'hooks/useHttpLocations'
import { WrappedTokenInfo } from 'state/lists/wrappedTokenInfo'
import Logo from 'components/Logo'
Expand Down Expand Up @@ -85,7 +86,11 @@ export default function CurrencyLogo({
}, [currency, uriLocations])

if (currency?.isNative) {
return <StyledEthereumLogo src={EthereumLogo} alt="ethereum logo" size={size} style={style} {...rest} />
return chainIdToNetworkName(currency.chainId) === 'ethereum' ? (
<StyledEthereumLogo src={EthereumLogo} alt="ethereum logo" size={size} style={style} {...rest} />
) : (
<StyledLogo srcs={[xDaiLogo]} alt="xdai logo" size={size} style={style} {...rest} />
)
}

return <StyledLogo size={size} srcs={srcs} alt={`${currency?.symbol ?? 'token'} logo`} style={style} {...rest} />
Expand Down
4 changes: 2 additions & 2 deletions src/custom/constants/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { WETH9 } from '@uniswap/sdk-core'
import { DAI_RINKEBY, USDC_RINKEBY, USDT_RINKEBY, WBTC_RINKEBY } from 'utils/rinkeby/constants'
import { DAI, USDC, USDT, WBTC } from 'constants/tokens'
import { USDC_XDAI, /*USDT_XDAI,*/ WBTC_XDAI, WETH_XDAI, WXDAI } from 'utils/xdai/constants'
import wxDaiLogo from 'assets/images/wxdai.png'

export * from './tokensMod'

Expand All @@ -24,7 +25,6 @@ export const ADDRESS_IMAGE_OVERRIDE = {
[USDC_XDAI.address]: getTrustImage(USDC.address),
// [USDT_XDAI.address]: getTrustImage(USDT.address),
[WBTC_XDAI.address]: getTrustImage(WBTC.address),
[WXDAI.address]:
'https://raw.githubusercontent.com/1Hive/default-token-list/master/src/assets/xdai/0xe91d153e0b41518a2ce8dd3d7944fa863463a97d/logo.png',
[WXDAI.address]: wxDaiLogo,
[WETH_XDAI.address]: getTrustImage(WETH_ADDRESS_MAINNET),
}

0 comments on commit ddf8ca6

Please sign in to comment.