Commit c5424d2d authored by Moody Salem's avatar Moody Salem

some tweaks to the token logo

parent 8b4bc167
...@@ -216,10 +216,13 @@ export default function CurrencyInputPanel({ ...@@ -216,10 +216,13 @@ export default function CurrencyInputPanel({
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}> <TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
{label} {label}
</TYPE.body> </TYPE.body>
{fiatValueOfTypedAmount ? <TYPE.label>${fiatValueOfTypedAmount?.toFixed(2)}</TYPE.label> : null} <TYPE.label>
{fiatValueOfTypedAmount ? '~' : ''}${fiatValueOfTypedAmount?.toSignificant(4) ?? '-'}
</TYPE.label>
</RowBetween> </RowBetween>
</LabelRow> </LabelRow>
)} )}
<InputRow style={hideInput ? { padding: '0', borderRadius: '8px' } : {}} selected={!onCurrencySelect}> <InputRow style={hideInput ? { padding: '0', borderRadius: '8px' } : {}} selected={!onCurrencySelect}>
<CurrencySelect <CurrencySelect
selected={!!currency} selected={!!currency}
......
import { Currency, ETHER, Token } from '@uniswap/sdk-core' import { ChainId, Currency, ETHER, Token } from '@uniswap/sdk-core'
import React, { useMemo } from 'react' import React, { useMemo } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import EthereumLogo from '../../assets/images/ethereum-logo.png' import EthereumLogo from '../../assets/images/ethereum-logo.png'
import useHttpLocations from '../../hooks/useHttpLocations' import useHttpLocations from '../../hooks/useHttpLocations'
import { WrappedTokenInfo } from '../../state/lists/hooks' import { WrappedTokenInfo } from '../../state/lists/hooks'
...@@ -41,10 +40,11 @@ export default function CurrencyLogo({ ...@@ -41,10 +40,11 @@ export default function CurrencyLogo({
if (currency === ETHER) return [] if (currency === ETHER) return []
if (currency instanceof Token) { if (currency instanceof Token) {
const defaultUrls = currency.chainId === ChainId.MAINNET ? [getTokenLogoURL(currency.address)] : []
if (currency instanceof WrappedTokenInfo) { if (currency instanceof WrappedTokenInfo) {
return [...uriLocations, getTokenLogoURL(currency.address)] return [...uriLocations, ...defaultUrls]
} }
return [getTokenLogoURL(currency.address)] return defaultUrls
} }
return [] return []
}, [currency, uriLocations]) }, [currency, uriLocations])
......
import React, { useState } from 'react' import React, { useState } from 'react'
import { HelpCircle } from 'react-feather' import { Slash } from 'react-feather'
import { ImageProps } from 'rebass' import { ImageProps } from 'rebass'
import useTheme from '../../hooks/useTheme'
const BAD_SRCS: { [tokenAddress: string]: true } = {} const BAD_SRCS: { [tokenAddress: string]: true } = {}
...@@ -11,9 +12,11 @@ export interface LogoProps extends Pick<ImageProps, 'style' | 'alt' | 'className ...@@ -11,9 +12,11 @@ export interface LogoProps extends Pick<ImageProps, 'style' | 'alt' | 'className
/** /**
* Renders an image by sequentially trying a list of URIs, and then eventually a fallback triangle alert * Renders an image by sequentially trying a list of URIs, and then eventually a fallback triangle alert
*/ */
export default function Logo({ srcs, alt, ...rest }: LogoProps) { export default function Logo({ srcs, alt, style, ...rest }: LogoProps) {
const [, refresh] = useState<number>(0) const [, refresh] = useState<number>(0)
const theme = useTheme()
const src: string | undefined = srcs.find((src) => !BAD_SRCS[src]) const src: string | undefined = srcs.find((src) => !BAD_SRCS[src])
if (src) { if (src) {
...@@ -30,5 +33,5 @@ export default function Logo({ srcs, alt, ...rest }: LogoProps) { ...@@ -30,5 +33,5 @@ export default function Logo({ srcs, alt, ...rest }: LogoProps) {
) )
} }
return <HelpCircle {...rest} /> return <Slash {...rest} style={{ ...style, color: theme.bg4 }} />
} }
...@@ -6,7 +6,7 @@ import { Token, ChainId } from '@uniswap/sdk-core' ...@@ -6,7 +6,7 @@ import { Token, ChainId } from '@uniswap/sdk-core'
import uriToHttp from 'utils/uriToHttp' import uriToHttp from 'utils/uriToHttp'
async function getColorFromToken(token: Token): Promise<string | null> { async function getColorFromToken(token: Token): Promise<string | null> {
if (token.chainId === ChainId.RINKEBY && token.address === '0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735') { if (token.chainId !== ChainId.MAINNET) {
return Promise.resolve('#FAAB14') return Promise.resolve('#FAAB14')
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment