Commit 97be3bcd authored by cartcrom's avatar cartcrom Committed by GitHub

fix: token selector spacing (#4314)

* fixed issue
* updated snapshot
parent a6de430c
...@@ -26,6 +26,11 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -26,6 +26,11 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
justify-content: flex-start; justify-content: flex-start;
} }
.c5 {
display: grid;
grid-auto-rows: auto;
}
.c1 { .c1 {
width: 100%; width: 100%;
display: -webkit-box; display: -webkit-box;
...@@ -50,6 +55,12 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -50,6 +55,12 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
justify-content: space-between; justify-content: space-between;
} }
.c8 {
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.c3 { .c3 {
padding: 4px 20px; padding: 4px 20px;
height: 56px; height: 56px;
...@@ -65,24 +76,12 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -65,24 +76,12 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
} }
.c6 { .c6 {
max-width: 90%;
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.c5 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
<div <div
style="position: relative; height: 10px; width: 100%; overflow: auto; will-change: transform; direction: ltr;" style="position: relative; height: 10px; width: 100%; overflow: auto; will-change: transform; direction: ltr;"
> >
...@@ -94,12 +93,16 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -94,12 +93,16 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
style="position: absolute; left: 0px; top: 0px; height: 56px; width: 100%;" style="position: absolute; left: 0px; top: 0px; height: 56px; width: 100%;"
tabindex="0" tabindex="0"
> >
CurrencyLogo currency=DAI
<div <div
class="c4" class="c4"
>
CurrencyLogo currency=DAI
</div>
<div
class="c5"
> >
<div <div
class="c5" class="c0 c1"
> >
<div <div
class="c6 css-vurnku" class="c6 css-vurnku"
...@@ -114,19 +117,30 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -114,19 +117,30 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
DAI DAI
</div> </div>
</div> </div>
<span /> <div
class="c4"
>
<div
class="c0 c1 c8"
style="justify-self: flex-end;"
/>
</div>
</div> </div>
<div <div
class="c0 c1 c2 c3 token-item-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" class="c0 c1 c2 c3 token-item-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
style="position: absolute; left: 0px; top: 56px; height: 56px; width: 100%;" style="position: absolute; left: 0px; top: 56px; height: 56px; width: 100%;"
tabindex="0" tabindex="0"
> >
CurrencyLogo currency=USDC
<div <div
class="c4" class="c4"
>
CurrencyLogo currency=USDC
</div>
<div
class="c5"
> >
<div <div
class="c5" class="c0 c1"
> >
<div <div
class="c6 css-vurnku" class="c6 css-vurnku"
...@@ -141,19 +155,30 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -141,19 +155,30 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
USDC USDC
</div> </div>
</div> </div>
<span /> <div
class="c4"
>
<div
class="c0 c1 c8"
style="justify-self: flex-end;"
/>
</div>
</div> </div>
<div <div
class="c0 c1 c2 c3 token-item-0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" class="c0 c1 c2 c3 token-item-0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
style="position: absolute; left: 0px; top: 112px; height: 56px; width: 100%;" style="position: absolute; left: 0px; top: 112px; height: 56px; width: 100%;"
tabindex="0" tabindex="0"
> >
CurrencyLogo currency=WBTC
<div <div
class="c4" class="c4"
>
CurrencyLogo currency=WBTC
</div>
<div
class="c5"
> >
<div <div
class="c5" class="c0 c1"
> >
<div <div
class="c6 css-vurnku" class="c6 css-vurnku"
...@@ -168,7 +193,14 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] = ...@@ -168,7 +193,14 @@ exports[`renders currency rows correctly when currencies list is non-empty 1`] =
WBTC WBTC
</div> </div>
</div> </div>
<span /> <div
class="c4"
>
<div
class="c0 c1 c8"
style="justify-self: flex-end;"
/>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -21,10 +21,10 @@ import { useCombinedActiveList } from '../../../state/lists/hooks' ...@@ -21,10 +21,10 @@ import { useCombinedActiveList } from '../../../state/lists/hooks'
import { WrappedTokenInfo } from '../../../state/lists/wrappedTokenInfo' import { WrappedTokenInfo } from '../../../state/lists/wrappedTokenInfo'
import { ThemedText } from '../../../theme' import { ThemedText } from '../../../theme'
import { isTokenOnList } from '../../../utils' import { isTokenOnList } from '../../../utils'
import Column from '../../Column' import Column, { AutoColumn } from '../../Column'
import CurrencyLogo from '../../CurrencyLogo' import CurrencyLogo from '../../CurrencyLogo'
import Loader from '../../Loader' import Loader from '../../Loader'
import { RowBetween, RowFixed } from '../../Row' import Row, { RowBetween, RowFixed } from '../../Row'
import { MouseoverTooltip } from '../../Tooltip' import { MouseoverTooltip } from '../../Tooltip'
import ImportRow from '../ImportRow' import ImportRow from '../ImportRow'
import { LoadingRows, MenuItem } from '../styleds' import { LoadingRows, MenuItem } from '../styleds'
...@@ -41,7 +41,6 @@ const StyledBalanceText = styled(Text)` ...@@ -41,7 +41,6 @@ const StyledBalanceText = styled(Text)`
` `
const CurrencyName = styled(Text)` const CurrencyName = styled(Text)`
max-width: 90%;
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -82,14 +81,9 @@ const TokenListLogoWrapper = styled.img` ...@@ -82,14 +81,9 @@ const TokenListLogoWrapper = styled.img`
height: 20px; height: 20px;
` `
const NameContainer = styled.div`
display: flex;
align-items: center;
`
function TokenTags({ currency }: { currency: Currency }) { function TokenTags({ currency }: { currency: Currency }) {
if (!(currency instanceof WrappedTokenInfo)) { if (!(currency instanceof WrappedTokenInfo)) {
return <span /> return null
} }
const tags = currency.tags const tags = currency.tags
...@@ -159,12 +153,15 @@ function CurrencyRow({ ...@@ -159,12 +153,15 @@ function CurrencyRow({
disabled={isSelected} disabled={isSelected}
selected={otherSelected} selected={otherSelected}
> >
<CurrencyLogo currency={currency} size={'24px'} />
<Column> <Column>
<NameContainer> <CurrencyLogo currency={currency} size={'24px'} />
</Column>
<AutoColumn>
<Row>
<CurrencyName title={currency.name}>{currency.name}</CurrencyName> <CurrencyName title={currency.name}>{currency.name}</CurrencyName>
{phase0Flag === Phase0Variant.Enabled && <TokenSafetyIcon warning={warning} />} {phase0Flag === Phase0Variant.Enabled && <TokenSafetyIcon warning={warning} />}
</NameContainer> </Row>
<ThemedText.DeprecatedDarkGray ml="0px" fontSize={'12px'} fontWeight={300}> <ThemedText.DeprecatedDarkGray ml="0px" fontSize={'12px'} fontWeight={300}>
{!currency.isNative && !isOnSelectedList && customAdded ? ( {!currency.isNative && !isOnSelectedList && customAdded ? (
<Trans>{currency.symbol} • Added by user</Trans> <Trans>{currency.symbol} • Added by user</Trans>
...@@ -172,8 +169,12 @@ function CurrencyRow({ ...@@ -172,8 +169,12 @@ function CurrencyRow({
currency.symbol currency.symbol
)} )}
</ThemedText.DeprecatedDarkGray> </ThemedText.DeprecatedDarkGray>
</AutoColumn>
<Column>
<RowFixed style={{ justifySelf: 'flex-end' }}>
<TokenTags currency={currency} />
</RowFixed>
</Column> </Column>
<TokenTags currency={currency} />
{showCurrencyAmount && ( {showCurrencyAmount && (
<RowFixed style={{ justifySelf: 'flex-end' }}> <RowFixed style={{ justifySelf: 'flex-end' }}>
{balance ? <Balance balance={balance} /> : account ? <Loader /> : null} {balance ? <Balance balance={balance} /> : account ? <Loader /> : null}
......
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