Commit 1897330f authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: omit native from DOM props (#3902)

fix: omit native from dom
parent 6131d007
...@@ -5,17 +5,23 @@ import styled from 'styled-components/macro' ...@@ -5,17 +5,23 @@ import styled from 'styled-components/macro'
import Logo from '../Logo' import Logo from '../Logo'
const StyledLogo = styled(Logo)<{ size: string; native: boolean }>` const StyledLogo = styled(Logo)<{ size: string }>`
width: ${({ size }) => size}; width: ${({ size }) => size};
height: ${({ size }) => size}; height: ${({ size }) => size};
background: radial-gradient(white 50%, #ffffff00 calc(75% + 1px), #ffffff00 100%); background: radial-gradient(white 50%, #ffffff00 calc(75% + 1px), #ffffff00 100%);
border-radius: 50%; border-radius: 50%;
-mox-box-shadow: 0 0 1px ${({ native }) => (native ? 'white' : 'black')}; -mox-box-shadow: 0 0 1px black;
-webkit-box-shadow: 0 0 1px ${({ native }) => (native ? 'white' : 'black')}; -webkit-box-shadow: 0 0 1px black;
box-shadow: 0 0 1px ${({ native }) => (native ? 'white' : 'black')}; box-shadow: 0 0 1px black;
border: 0px solid rgba(255, 255, 255, 0); border: 0px solid rgba(255, 255, 255, 0);
` `
const StyledNativeLogo = styled(StyledLogo)`
-mox-box-shadow: 0 0 1px white;
-webkit-box-shadow: 0 0 1px white;
box-shadow: 0 0 1px white;
`
export default function CurrencyLogo({ export default function CurrencyLogo({
currency, currency,
size = '24px', size = '24px',
...@@ -26,16 +32,13 @@ export default function CurrencyLogo({ ...@@ -26,16 +32,13 @@ export default function CurrencyLogo({
size?: string size?: string
style?: React.CSSProperties style?: React.CSSProperties
}) { }) {
const logoURIs = useCurrencyLogoURIs(currency) const props = {
alt: `${currency?.symbol ?? 'token'} logo`,
size,
srcs: useCurrencyLogoURIs(currency),
style,
...rest,
}
return ( return currency?.isNative ? <StyledNativeLogo {...props} /> : <StyledLogo {...props} />
<StyledLogo
size={size}
native={currency?.isNative ?? false}
srcs={logoURIs}
alt={`${currency?.symbol ?? 'token'} logo`}
style={style}
{...rest}
/>
)
} }
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