Commit 1839e145 authored by cartcrom's avatar cartcrom Committed by GitHub

style: updating explore language and css (#4772)

* finished updating explore language and css
* implemented feedback from fred
* refactored css for row height
* extended filter option
parent 8c1e41a3
...@@ -64,7 +64,6 @@ const StyledMenuContent = styled.div` ...@@ -64,7 +64,6 @@ const StyledMenuContent = styled.div`
gap: 8px; gap: 8px;
align-items: center; align-items: center;
border: none; border: none;
width: 100%;
font-weight: 600; font-weight: 600;
vertical-align: middle; vertical-align: middle;
` `
...@@ -85,6 +84,9 @@ const CheckContainer = styled.div` ...@@ -85,6 +84,9 @@ const CheckContainer = styled.div`
display: flex; display: flex;
flex-direction: flex-end; flex-direction: flex-end;
` `
const NetworkFilterOption = styled(FilterOption)`
width: 156px;
`
export default function NetworkFilter() { export default function NetworkFilter() {
const theme = useTheme() const theme = useTheme()
...@@ -101,7 +103,7 @@ export default function NetworkFilter() { ...@@ -101,7 +103,7 @@ export default function NetworkFilter() {
return ( return (
<StyledMenu ref={node}> <StyledMenu ref={node}>
<FilterOption onClick={toggleMenu} aria-label={`networkFilter`} active={open}> <NetworkFilterOption onClick={toggleMenu} aria-label={`networkFilter`} active={open}>
<StyledMenuContent> <StyledMenuContent>
<NetworkLabel> <NetworkLabel>
<Logo src={circleLogoUrl ?? logoUrl} /> {label} <Logo src={circleLogoUrl ?? logoUrl} /> {label}
...@@ -114,7 +116,7 @@ export default function NetworkFilter() { ...@@ -114,7 +116,7 @@ export default function NetworkFilter() {
)} )}
</Chevron> </Chevron>
</StyledMenuContent> </StyledMenuContent>
</FilterOption> </NetworkFilterOption>
{open && ( {open && (
<MenuTimeFlyout> <MenuTimeFlyout>
{BACKEND_CHAIN_NAMES.map((network) => { {BACKEND_CHAIN_NAMES.map((network) => {
......
...@@ -23,10 +23,10 @@ const SearchInput = styled.input` ...@@ -23,10 +23,10 @@ const SearchInput = styled.input`
background-position: 12px center; background-position: 12px center;
background-color: ${({ theme }) => theme.backgroundModule}; background-color: ${({ theme }) => theme.backgroundModule};
border-radius: 12px; border-radius: 12px;
border: 1px solid ${({ theme }) => theme.backgroundOutline}; border: 1.5px solid ${({ theme }) => theme.backgroundOutline};
height: 100%; height: 100%;
width: min(200px, 100%); width: min(200px, 100%);
font-size: 16px; font-size: 14px;
padding-left: 40px; padding-left: 40px;
color: ${({ theme }) => theme.textSecondary}; color: ${({ theme }) => theme.textSecondary};
transition-duration: ${({ theme }) => theme.transition.duration.fast}; transition-duration: ${({ theme }) => theme.transition.duration.fast};
......
...@@ -7,7 +7,7 @@ import CurrencyLogo from 'components/CurrencyLogo' ...@@ -7,7 +7,7 @@ import CurrencyLogo from 'components/CurrencyLogo'
import { getChainInfo } from 'constants/chainInfo' import { getChainInfo } from 'constants/chainInfo'
import { FavoriteTokensVariant, useFavoriteTokensFlag } from 'featureFlags/flags/favoriteTokens' import { FavoriteTokensVariant, useFavoriteTokensFlag } from 'featureFlags/flags/favoriteTokens'
import { TokenSortMethod, TopToken } from 'graphql/data/TopTokens' import { TokenSortMethod, TopToken } from 'graphql/data/TopTokens'
import { CHAIN_NAME_TO_CHAIN_ID, getTokenDetailsURL, TimePeriod } from 'graphql/data/util' import { CHAIN_NAME_TO_CHAIN_ID, getTokenDetailsURL } from 'graphql/data/util'
import { useAtomValue } from 'jotai/utils' import { useAtomValue } from 'jotai/utils'
import { ForwardedRef, forwardRef } from 'react' import { ForwardedRef, forwardRef } from 'react'
import { CSSProperties, ReactNode } from 'react' import { CSSProperties, ReactNode } from 'react'
...@@ -35,7 +35,6 @@ import { ...@@ -35,7 +35,6 @@ import {
} from '../state' } from '../state'
import { useTokenLogoURI } from '../TokenDetails/ChartSection' import { useTokenLogoURI } from '../TokenDetails/ChartSection'
import { formatDelta, getDeltaArrow } from '../TokenDetails/PriceChart' import { formatDelta, getDeltaArrow } from '../TokenDetails/PriceChart'
import { DISPLAYS } from './TimeSelector'
const Cell = styled.div` const Cell = styled.div`
display: flex; display: flex;
...@@ -50,15 +49,17 @@ const StyledTokenRow = styled.div<{ ...@@ -50,15 +49,17 @@ const StyledTokenRow = styled.div<{
}>` }>`
background-color: transparent; background-color: transparent;
display: grid; display: grid;
font-size: 15px; font-size: 16px;
grid-template-columns: ${({ favoriteTokensEnabled }) => grid-template-columns: ${({ favoriteTokensEnabled }) =>
favoriteTokensEnabled ? '1fr 7fr 4fr 4fr 4fr 4fr 5fr 1.2fr' : '1fr 7fr 4fr 4fr 4fr 4fr 5fr'}; favoriteTokensEnabled ? '1fr 7fr 4fr 4fr 4fr 4fr 5fr 1.2fr' : '1fr 7fr 4fr 4fr 4fr 4fr 5fr'};
height: 60px;
line-height: 24px; line-height: 24px;
max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT}; max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT};
min-width: 390px; min-width: 390px;
padding-top: ${({ first }) => (first ? '4px' : '0px')}; ${({ first, last }) => css`
padding-bottom: ${({ last }) => (last ? '4px' : '0px')}; height: ${first || last ? '72px' : '64px'};
padding-top: ${first ? '8px' : '0px'};
padding-bottom: ${last ? '8px' : '0px'};
`}
padding-left: 12px; padding-left: 12px;
padding-right: 12px; padding-right: 12px;
transition: ${({ transition: ${({
...@@ -150,7 +151,7 @@ const StyledHeaderRow = styled(StyledTokenRow)` ...@@ -150,7 +151,7 @@ const StyledHeaderRow = styled(StyledTokenRow)`
border-color: ${({ theme }) => theme.backgroundOutline}; border-color: ${({ theme }) => theme.backgroundOutline};
border-radius: 8px 8px 0px 0px; border-radius: 8px 8px 0px 0px;
color: ${({ theme }) => theme.textSecondary}; color: ${({ theme }) => theme.textSecondary};
font-size: 12px; font-size: 14px;
height: 48px; height: 48px;
line-height: 16px; line-height: 16px;
padding: 0px 12px; padding: 0px 12px;
...@@ -169,6 +170,7 @@ const StyledHeaderRow = styled(StyledTokenRow)` ...@@ -169,6 +170,7 @@ const StyledHeaderRow = styled(StyledTokenRow)`
const ListNumberCell = styled(Cell)<{ header: boolean }>` const ListNumberCell = styled(Cell)<{ header: boolean }>`
color: ${({ theme }) => theme.textSecondary}; color: ${({ theme }) => theme.textSecondary};
min-width: 32px; min-width: 32px;
font-size: 14px;
height: ${({ header }) => (header ? '48px' : '60px')}; height: ${({ header }) => (header ? '48px' : '60px')};
@media only screen and (max-width: ${SMALL_MEDIA_BREAKPOINT}) { @media only screen and (max-width: ${SMALL_MEDIA_BREAKPOINT}) {
...@@ -328,13 +330,6 @@ export const LogoContainer = styled.div` ...@@ -328,13 +330,6 @@ export const LogoContainer = styled.div`
display: flex; display: flex;
` `
/* formatting for volume with timeframe header display */
function getHeaderDisplay(method: string, timeframe: TimePeriod): string {
if (method === TokenSortMethod.VOLUME || method === TokenSortMethod.PERCENT_CHANGE)
return `${DISPLAYS[timeframe]} ${method}`
return method
}
/* Get singular header cell for header row */ /* Get singular header cell for header row */
function HeaderCell({ function HeaderCell({
category, category,
...@@ -347,19 +342,18 @@ function HeaderCell({ ...@@ -347,19 +342,18 @@ function HeaderCell({
const sortAscending = useAtomValue(sortAscendingAtom) const sortAscending = useAtomValue(sortAscendingAtom)
const handleSortCategory = useSetSortMethod(category) const handleSortCategory = useSetSortMethod(category)
const sortMethod = useAtomValue(sortMethodAtom) const sortMethod = useAtomValue(sortMethodAtom)
const timeframe = useAtomValue(filterTimeAtom)
if (sortMethod === category) { if (sortMethod === category) {
return ( return (
<HeaderCellWrapper onClick={handleSortCategory}> <HeaderCellWrapper onClick={handleSortCategory}>
<SortArrowCell> <SortArrowCell>
{sortAscending ? ( {sortAscending ? (
<ArrowUp size={14} color={theme.accentActive} /> <ArrowUp size={20} strokeWidth={1.8} color={theme.accentActive} />
) : ( ) : (
<ArrowDown size={14} color={theme.accentActive} /> <ArrowDown size={20} strokeWidth={1.8} color={theme.accentActive} />
)} )}
</SortArrowCell> </SortArrowCell>
{getHeaderDisplay(category, timeframe)} {category}
</HeaderCellWrapper> </HeaderCellWrapper>
) )
} }
...@@ -369,11 +363,11 @@ function HeaderCell({ ...@@ -369,11 +363,11 @@ function HeaderCell({
<SortArrowCell> <SortArrowCell>
<ArrowUp size={14} visibility="hidden" /> <ArrowUp size={14} visibility="hidden" />
</SortArrowCell> </SortArrowCell>
{getHeaderDisplay(category, timeframe)} {category}
</HeaderCellWrapper> </HeaderCellWrapper>
) )
} }
return <HeaderCellWrapper>{getHeaderDisplay(category, timeframe)}</HeaderCellWrapper> return <HeaderCellWrapper>{category}</HeaderCellWrapper>
} }
/* Token Row: skeleton row component */ /* Token Row: skeleton row component */
......
...@@ -22,13 +22,16 @@ const GridContainer = styled.div` ...@@ -22,13 +22,16 @@ const GridContainer = styled.div`
0px 24px 32px rgba(0, 0, 0, 0.01); 0px 24px 32px rgba(0, 0, 0, 0.01);
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
border-radius: 8px; border-radius: 12px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border: 1px solid ${({ theme }) => theme.backgroundOutline}; border: 1px solid ${({ theme }) => theme.backgroundOutline};
` `
const TokenDataContainer = styled.div` const TokenDataContainer = styled.div`
display: flex;
flex-direction: column;
gap: 4px;
height: 100%; height: 100%;
width: 100%; width: 100%;
` `
......
...@@ -8,7 +8,7 @@ export const favoritesAtom = atomWithStorage<string[]>('favorites', []) ...@@ -8,7 +8,7 @@ export const favoritesAtom = atomWithStorage<string[]>('favorites', [])
export const showFavoritesAtom = atomWithStorage<boolean>('showFavorites', false) export const showFavoritesAtom = atomWithStorage<boolean>('showFavorites', false)
export const filterStringAtom = atomWithReset<string>('') export const filterStringAtom = atomWithReset<string>('')
export const filterTimeAtom = atom<TimePeriod>(TimePeriod.DAY) export const filterTimeAtom = atom<TimePeriod>(TimePeriod.DAY)
export const sortMethodAtom = atom<TokenSortMethod>(TokenSortMethod.TOTAL_VALUE_LOCKED) export const sortMethodAtom = atom<TokenSortMethod>(TokenSortMethod.VOLUME)
export const sortAscendingAtom = atom<boolean>(false) export const sortAscendingAtom = atom<boolean>(false)
/* for favoriting tokens */ /* for favoriting tokens */
......
...@@ -30,11 +30,8 @@ const ExploreContainer = styled.div` ...@@ -30,11 +30,8 @@ const ExploreContainer = styled.div`
padding-top: 20px; padding-top: 20px;
} }
` `
const TokenTableContainer = styled.div`
padding: 16px 0px;
`
export const TitleContainer = styled.div` export const TitleContainer = styled.div`
margin-bottom: 16px; margin-bottom: 32px;
max-width: 960px; max-width: 960px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
...@@ -62,6 +59,7 @@ const FiltersWrapper = styled.div` ...@@ -62,6 +59,7 @@ const FiltersWrapper = styled.div`
display: flex; display: flex;
max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT}; max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT};
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px;
@media only screen and (max-width: ${MEDIUM_MEDIA_BREAKPOINT}) { @media only screen and (max-width: ${MEDIUM_MEDIA_BREAKPOINT}) {
flex-direction: column; flex-direction: column;
...@@ -86,7 +84,7 @@ const Tokens = () => { ...@@ -86,7 +84,7 @@ const Tokens = () => {
<ExploreContainer> <ExploreContainer>
<TitleContainer> <TitleContainer>
<ThemedText.LargeHeader> <ThemedText.LargeHeader>
<Trans>Explore Tokens</Trans> <Trans>Top tokens on Uniswap</Trans>
</ThemedText.LargeHeader> </ThemedText.LargeHeader>
</TitleContainer> </TitleContainer>
<FiltersWrapper> <FiltersWrapper>
...@@ -99,9 +97,7 @@ const Tokens = () => { ...@@ -99,9 +97,7 @@ const Tokens = () => {
<SearchBar /> <SearchBar />
</SearchContainer> </SearchContainer>
</FiltersWrapper> </FiltersWrapper>
<TokenTableContainer> <TokenTable />
<TokenTable />
</TokenTableContainer>
</ExploreContainer> </ExploreContainer>
</Trace> </Trace>
) )
...@@ -112,7 +108,7 @@ export const LoadingTokens = () => { ...@@ -112,7 +108,7 @@ export const LoadingTokens = () => {
<ExploreContainer> <ExploreContainer>
<TitleContainer> <TitleContainer>
<ThemedText.LargeHeader> <ThemedText.LargeHeader>
<Trans>Explore Tokens</Trans> <Trans>Top tokens on Uniswap</Trans>
</ThemedText.LargeHeader> </ThemedText.LargeHeader>
</TitleContainer> </TitleContainer>
<FiltersWrapper> <FiltersWrapper>
...@@ -125,9 +121,7 @@ export const LoadingTokens = () => { ...@@ -125,9 +121,7 @@ export const LoadingTokens = () => {
<SearchBar /> <SearchBar />
</SearchContainer> </SearchContainer>
</FiltersWrapper> </FiltersWrapper>
<TokenTableContainer> <LoadingTokenTable />
<LoadingTokenTable />
</TokenTableContainer>
</ExploreContainer> </ExploreContainer>
) )
} }
......
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