Commit 7ee41abd authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

feat: design refresh on pool list items (#6230)

* update LP tags

* design feedback
parent 581c0982
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import Badge, { BadgeVariant } from 'components/Badge' import { AlertTriangle, Slash } from 'react-feather'
import { AlertCircle } from 'react-feather' import styled, { useTheme } from 'styled-components/macro'
import styled from 'styled-components/macro'
import { MouseoverTooltip } from '../../components/Tooltip' import { MouseoverTooltip } from '../../components/Tooltip'
...@@ -13,7 +12,9 @@ const BadgeWrapper = styled.div` ...@@ -13,7 +12,9 @@ const BadgeWrapper = styled.div`
const BadgeText = styled.div` const BadgeText = styled.div`
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 12px;
line-height: 14px;
margin-right: 8px;
` `
const ActiveDot = styled.span` const ActiveDot = styled.span`
...@@ -21,7 +22,14 @@ const ActiveDot = styled.span` ...@@ -21,7 +22,14 @@ const ActiveDot = styled.span`
border-radius: 50%; border-radius: 50%;
height: 8px; height: 8px;
width: 8px; width: 8px;
margin-right: 4px; `
const LabelText = styled.div<{ color: string }>`
align-items: center;
color: ${({ color }) => color};
display: flex;
flex-direction: row;
justify-content: flex-end;
` `
export default function RangeBadge({ export default function RangeBadge({
...@@ -31,17 +39,17 @@ export default function RangeBadge({ ...@@ -31,17 +39,17 @@ export default function RangeBadge({
removed: boolean | undefined removed: boolean | undefined
inRange: boolean | undefined inRange: boolean | undefined
}) { }) {
const theme = useTheme()
return ( return (
<BadgeWrapper> <BadgeWrapper>
{removed ? ( {removed ? (
<MouseoverTooltip text={<Trans>Your position has 0 liquidity, and is not earning fees.</Trans>}> <MouseoverTooltip text={<Trans>Your position has 0 liquidity, and is not earning fees.</Trans>}>
<Badge variant={BadgeVariant.DEFAULT}> <LabelText color={theme.textSecondary}>
<AlertCircle width={14} height={14} />
&nbsp;
<BadgeText> <BadgeText>
<Trans>Closed</Trans> <Trans>Closed</Trans>
</BadgeText> </BadgeText>
</Badge> <Slash width={12} height={12} />
</LabelText>
</MouseoverTooltip> </MouseoverTooltip>
) : inRange ? ( ) : inRange ? (
<MouseoverTooltip <MouseoverTooltip
...@@ -51,12 +59,12 @@ export default function RangeBadge({ ...@@ -51,12 +59,12 @@ export default function RangeBadge({
</Trans> </Trans>
} }
> >
<Badge variant={BadgeVariant.DEFAULT}> <LabelText color={theme.accentSuccess}>
<ActiveDot /> &nbsp;
<BadgeText> <BadgeText>
<Trans>In range</Trans> <Trans>In Range</Trans>
</BadgeText> </BadgeText>
</Badge> <ActiveDot />
</LabelText>
</MouseoverTooltip> </MouseoverTooltip>
) : ( ) : (
<MouseoverTooltip <MouseoverTooltip
...@@ -66,13 +74,12 @@ export default function RangeBadge({ ...@@ -66,13 +74,12 @@ export default function RangeBadge({
</Trans> </Trans>
} }
> >
<Badge variant={BadgeVariant.WARNING}> <LabelText color={theme.accentWarning}>
<AlertCircle width={14} height={14} />
&nbsp;
<BadgeText> <BadgeText>
<Trans>Out of range</Trans> <Trans>Out of range</Trans>
</BadgeText> </BadgeText>
</Badge> <AlertTriangle width={12} height={12} />
</LabelText>
</MouseoverTooltip> </MouseoverTooltip>
)} )}
</BadgeWrapper> </BadgeWrapper>
......
...@@ -2,7 +2,6 @@ import { BigNumber } from '@ethersproject/bignumber' ...@@ -2,7 +2,6 @@ import { BigNumber } from '@ethersproject/bignumber'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Percent, Price, Token } from '@uniswap/sdk-core' import { Percent, Price, Token } from '@uniswap/sdk-core'
import { Position } from '@uniswap/v3-sdk' import { Position } from '@uniswap/v3-sdk'
import Badge from 'components/Badge'
import RangeBadge from 'components/Badge/RangeBadge' import RangeBadge from 'components/Badge/RangeBadge'
import DoubleCurrencyLogo from 'components/DoubleLogo' import DoubleCurrencyLogo from 'components/DoubleLogo'
import HoverInlineText from 'components/HoverInlineText' import HoverInlineText from 'components/HoverInlineText'
...@@ -15,7 +14,7 @@ import { useMemo } from 'react' ...@@ -15,7 +14,7 @@ import { useMemo } from 'react'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { Bound } from 'state/mint/v3/actions' import { Bound } from 'state/mint/v3/actions'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme' import { HideSmall, MEDIA_WIDTHS, SmallOnly, ThemedText } from 'theme'
import { formatTickPrice } from 'utils/formatTickPrice' import { formatTickPrice } from 'utils/formatTickPrice'
import { unwrappedToken } from 'utils/unwrappedToken' import { unwrappedToken } from 'utils/unwrappedToken'
import { hasURL } from 'utils/urlChecks' import { hasURL } from 'utils/urlChecks'
...@@ -52,14 +51,6 @@ const LinkRow = styled(Link)` ...@@ -52,14 +51,6 @@ const LinkRow = styled(Link)`
`}; `};
` `
const BadgeText = styled.div`
font-weight: 500;
font-size: 14px;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
font-size: 12px;
`};
`
const DataLineItem = styled.div` const DataLineItem = styled.div`
font-size: 14px; font-size: 14px;
` `
...@@ -73,20 +64,27 @@ const RangeLineItem = styled(DataLineItem)` ...@@ -73,20 +64,27 @@ const RangeLineItem = styled(DataLineItem)`
` `
const DoubleArrow = styled.span` const DoubleArrow = styled.span`
font-size: 12px;
margin: 0 2px; margin: 0 2px;
color: ${({ theme }) => theme.textTertiary}; color: ${({ theme }) => theme.textTertiary};
` `
const RangeText = styled.div` const RangeText = styled(ThemedText.Caption)`
font-size: 12px !important;
word-break: break-word; word-break: break-word;
padding: 0.25rem 0.25rem; padding: 0.25rem 0.25rem;
border-radius: 8px; border-radius: 8px;
` `
const ExtentsText = styled.span` const FeeTierText = styled(ThemedText.UtilityBadge)`
font-size: 10px !important;
margin-left: 14px !important;
`
const ExtentsText = styled(ThemedText.Caption)`
color: ${({ theme }) => theme.textTertiary}; color: ${({ theme }) => theme.textTertiary};
font-size: 14px; display: inline-block;
margin-right: 4px; line-height: 16px;
margin-right: 4px !important;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall` ${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
display: none; display: none;
`}; `};
...@@ -101,15 +99,6 @@ const PrimaryPositionIdData = styled.div` ...@@ -101,15 +99,6 @@ const PrimaryPositionIdData = styled.div`
} }
` `
const DataText = styled.div`
font-weight: 600;
font-size: 18px;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
font-size: 18px;
`};
`
interface PositionListItemProps { interface PositionListItemProps {
token0: string token0: string
token1: string token1: string
...@@ -228,15 +217,13 @@ export default function PositionListItem({ ...@@ -228,15 +217,13 @@ export default function PositionListItem({
<RowBetween> <RowBetween>
<PrimaryPositionIdData> <PrimaryPositionIdData>
<DoubleCurrencyLogo currency0={currencyBase} currency1={currencyQuote} size={18} margin /> <DoubleCurrencyLogo currency0={currencyBase} currency1={currencyQuote} size={18} margin />
<DataText> <ThemedText.SubHeader>
&nbsp;{currencyQuote?.symbol}&nbsp;/&nbsp;{currencyBase?.symbol} &nbsp;{currencyQuote?.symbol}&nbsp;/&nbsp;{currencyBase?.symbol}
</DataText> </ThemedText.SubHeader>
&nbsp;
<Badge> <FeeTierText>
<BadgeText>
<Trans>{new Percent(feeAmount, 1_000_000).toSignificant()}%</Trans> <Trans>{new Percent(feeAmount, 1_000_000).toSignificant()}%</Trans>
</BadgeText> </FeeTierText>
</Badge>
</PrimaryPositionIdData> </PrimaryPositionIdData>
<RangeBadge removed={removed} inRange={!outOfRange} /> <RangeBadge removed={removed} inRange={!outOfRange} />
</RowBetween> </RowBetween>
...@@ -259,10 +246,10 @@ export default function PositionListItem({ ...@@ -259,10 +246,10 @@ export default function PositionListItem({
</Trans> </Trans>
</RangeText>{' '} </RangeText>{' '}
<HideSmall> <HideSmall>
<DoubleArrow></DoubleArrow>{' '} <DoubleArrow></DoubleArrow>{' '}
</HideSmall> </HideSmall>
<SmallOnly> <SmallOnly>
<DoubleArrow></DoubleArrow>{' '} <DoubleArrow></DoubleArrow>{' '}
</SmallOnly> </SmallOnly>
<RangeText> <RangeText>
<ExtentsText> <ExtentsText>
......
...@@ -10,7 +10,7 @@ export const darkTheme: Theme = { ...@@ -10,7 +10,7 @@ export const darkTheme: Theme = {
explicitWhite: '#FFFFFF', explicitWhite: '#FFFFFF',
green: vars.color.green200, green: vars.color.green200,
gold: vars.color.gold400, gold: vars.color.gold200,
violet: vars.color.violet200, violet: vars.color.violet200,
backgroundFloating: '0000000C', backgroundFloating: '0000000C',
......
...@@ -149,14 +149,14 @@ export const darkTheme = { ...@@ -149,14 +149,14 @@ export const darkTheme = {
accentAction: colors.blue400, accentAction: colors.blue400,
accentActive: colors.blue400, accentActive: colors.blue400,
accentSuccess: colors.green200, accentSuccess: colors.green200,
accentWarning: colors.gold400, accentWarning: colors.gold200,
accentFailure: colors.red300, accentFailure: colors.red300,
accentCritical: colors.red300, accentCritical: colors.red300,
accentActionSoft: opacify(24, colors.blue400), accentActionSoft: opacify(24, colors.blue400),
accentActiveSoft: opacify(24, colors.blue400), accentActiveSoft: opacify(24, colors.blue400),
accentSuccessSoft: opacify(24, colors.green400), accentSuccessSoft: opacify(24, colors.green400),
accentWarningSoft: opacify(24, colors.gold400), accentWarningSoft: opacify(24, colors.gold200),
accentFailureSoft: opacify(12, colors.red300), accentFailureSoft: opacify(12, colors.red300),
accentTextDarkPrimary: opacify(80, colors.gray900), accentTextDarkPrimary: opacify(80, colors.gray900),
......
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