Commit 80edf5a0 authored by lynn's avatar lynn Committed by GitHub

fix: follow custom design for token selector scrollbar (#5952)

* fix

* remove unused styled component

* update snapshot

* disable scroll on larger currency search modal

* update snapshot
parent 96f69291
import { style } from '@vanilla-extract/css'
import { themeVars } from 'nft/css/sprinkles.css'
export const scrollbarStyle = style([
{
scrollbarWidth: 'thin',
scrollbarColor: `${themeVars.colors.backgroundOutline} transparent`,
height: '100%',
selectors: {
'&::-webkit-scrollbar': {
background: 'transparent',
width: '4px',
},
'&::-webkit-scrollbar-thumb': {
background: `${themeVars.colors.backgroundOutline}`,
borderRadius: '8px',
},
},
},
])
...@@ -20,6 +20,7 @@ import CurrencyLogo from '../../Logo/CurrencyLogo' ...@@ -20,6 +20,7 @@ import CurrencyLogo from '../../Logo/CurrencyLogo'
import Row, { RowFixed } from '../../Row' import Row, { RowFixed } from '../../Row'
import { MouseoverTooltip } from '../../Tooltip' import { MouseoverTooltip } from '../../Tooltip'
import { LoadingRows, MenuItem } from '../styleds' import { LoadingRows, MenuItem } from '../styleds'
import * as styles from './index.css'
function currencyKey(currency: Currency): string { function currencyKey(currency: Currency): string {
return currency.isToken ? currency.address : 'ETHER' return currency.isToken ? currency.address : 'ETHER'
...@@ -288,21 +289,34 @@ export default function CurrencyList({ ...@@ -288,21 +289,34 @@ export default function CurrencyList({
return currencyKey(currency) return currencyKey(currency)
}, []) }, [])
return isLoading ? ( return (
<FixedSizeList height={height} ref={fixedListRef as any} width="100%" itemData={[]} itemCount={10} itemSize={56}> <div style={{ paddingRight: '8px', paddingTop: '8px' }}>
{LoadingRow} {isLoading ? (
</FixedSizeList> <FixedSizeList
) : ( className={styles.scrollbarStyle}
<FixedSizeList height={height}
height={height} ref={fixedListRef as any}
ref={fixedListRef as any} width="100%"
width="100%" itemData={[]}
itemData={itemData} itemCount={10}
itemCount={itemData.length} itemSize={56}
itemSize={56} >
itemKey={itemKey} {LoadingRow}
> </FixedSizeList>
{Row} ) : (
</FixedSizeList> <FixedSizeList
className={styles.scrollbarStyle}
height={height}
ref={fixedListRef as any}
width="100%"
itemData={itemData}
itemCount={itemData.length}
itemSize={56}
itemKey={itemKey}
>
{Row}
</FixedSizeList>
)}
</div>
) )
} }
...@@ -32,6 +32,7 @@ import { PaddedColumn, SearchInput, Separator } from './styleds' ...@@ -32,6 +32,7 @@ import { PaddedColumn, SearchInput, Separator } from './styleds'
const ContentWrapper = styled(Column)` const ContentWrapper = styled(Column)`
background-color: ${({ theme }) => theme.backgroundSurface}; background-color: ${({ theme }) => theme.backgroundSurface};
width: 100%; width: 100%;
overflow: hidden;
flex: 1 1; flex: 1 1;
position: relative; position: relative;
` `
......
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