Commit fa4688d9 authored by Callil Capuozzo's avatar Callil Capuozzo Committed by GitHub

UI improvements (#1505)

* Change price ratio using slash to "per"

* Fix header, toggle copy and increase copy

* Add clearer V2 and migrate buttons

* Fix link

* fix account modal background color

* tweak sig figs
Co-authored-by: default avatarNoah Zinsmeister <noahwz@gmail.com>
parent 7ee761a5
...@@ -76,7 +76,6 @@ const AccountGroupingRow = styled.div` ...@@ -76,7 +76,6 @@ const AccountGroupingRow = styled.div`
` `
const AccountSection = styled.div` const AccountSection = styled.div`
background-color: ${({ theme }) => theme.bg1};
padding: 0rem 1rem; padding: 0rem 1rem;
${({ theme }) => theme.mediaWidth.upToMedium`padding: 0rem 1rem 1.5rem 1rem;`}; ${({ theme }) => theme.mediaWidth.upToMedium`padding: 0rem 1rem 1.5rem 1rem;`};
` `
......
...@@ -46,7 +46,7 @@ export default function RangeBadge({ ...@@ -46,7 +46,7 @@ export default function RangeBadge({
<BadgeWrapper> <BadgeWrapper>
{removed ? ( {removed ? (
<MouseoverTooltip text={`Your position has 0 liquidity, and is not earning fees.`}> <MouseoverTooltip text={`Your position has 0 liquidity, and is not earning fees.`}>
<Badge variant={BadgeVariant.WARNING_OUTLINE}> <Badge variant={BadgeVariant.DEFAULT}>
<AlertCircle width={14} height={14} /> <AlertCircle width={14} height={14} />
&nbsp; &nbsp;
<BadgeText>{t('Inactive')}</BadgeText> <BadgeText>{t('Inactive')}</BadgeText>
......
...@@ -90,7 +90,7 @@ const HeaderElement = styled.div` ...@@ -90,7 +90,7 @@ const HeaderElement = styled.div`
} }
${({ theme }) => theme.mediaWidth.upToMedium` ${({ theme }) => theme.mediaWidth.upToMedium`
flex-direction: row-reverse; flex-direction: row-reverse;
align-items: center; align-items: center;
`}; `};
` `
...@@ -116,6 +116,9 @@ const HeaderLinks = styled(Row)` ...@@ -116,6 +116,9 @@ const HeaderLinks = styled(Row)`
grid-auto-flow: column; grid-auto-flow: column;
grid-gap: 10px; grid-gap: 10px;
overflow: auto; overflow: auto;
${({ theme }) => theme.mediaWidth.upToMedium`
justify-self: flex-end;
`};
` `
const AccountElement = styled.div<{ active: boolean }>` const AccountElement = styled.div<{ active: boolean }>`
......
...@@ -139,7 +139,7 @@ const StepCounter = ({ ...@@ -139,7 +139,7 @@ const StepCounter = ({
}} }}
/> />
<InputTitle fontSize={12} textAlign="center"> <InputTitle fontSize={12} textAlign="center">
{tokenB + ' / ' + tokenA} {tokenB + ' per ' + tokenA}
</InputTitle> </InputTitle>
</AutoColumn> </AutoColumn>
{!locked ? ( {!locked ? (
......
...@@ -198,28 +198,23 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -198,28 +198,23 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
<CardNoise /> <CardNoise />
<AutoColumn gap="12px"> <AutoColumn gap="12px">
<FixedHeightRow> <FixedHeightRow>
<AutoRow gap="8px"> <AutoRow gap="8px" style={{ marginLeft: '8px' }}>
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} /> <DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`} {!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`}
</Text> </Text>
</AutoRow> </AutoRow>
<RowFixed gap="8px"> <RowFixed gap="8px" style={{ marginRight: '4px' }}>
<ButtonEmpty <ButtonEmpty padding="6px 8px" borderRadius="12px" width="100%" onClick={() => setShowMore(!showMore)}>
padding="6px 8px"
borderRadius="12px"
width="fit-content"
onClick={() => setShowMore(!showMore)}
>
{showMore ? ( {showMore ? (
<> <>
Manage Manage
<ChevronUp size="20" style={{ marginLeft: '10px' }} /> <ChevronUp size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} />
</> </>
) : ( ) : (
<> <>
Manage Manage
<ChevronDown size="20" style={{ marginLeft: '10px' }} /> <ChevronDown size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} />
</> </>
)} )}
</ButtonEmpty> </ButtonEmpty>
......
...@@ -244,7 +244,7 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr ...@@ -244,7 +244,7 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
> >
<RangeText> <RangeText>
<ExtentsText>Min: </ExtentsText> <ExtentsText>Min: </ExtentsText>
{formatPrice(priceLower, 4)} {manuallyInverted ? currencyQuote?.symbol : currencyBase?.symbol} {' / '}{' '} {formatPrice(priceLower, 5)} {manuallyInverted ? currencyQuote?.symbol : currencyBase?.symbol} {' per '}{' '}
{manuallyInverted ? currencyBase?.symbol : currencyQuote?.symbol} {manuallyInverted ? currencyBase?.symbol : currencyQuote?.symbol}
</RangeText>{' '} </RangeText>{' '}
<HideSmall> <HideSmall>
...@@ -255,7 +255,7 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr ...@@ -255,7 +255,7 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
</SmallOnly> </SmallOnly>
<RangeText> <RangeText>
<ExtentsText>Max:</ExtentsText> <ExtentsText>Max:</ExtentsText>
{formatPrice(priceUpper, 4)} {manuallyInverted ? currencyQuote?.symbol : currencyBase?.symbol} {' / '}{' '} {formatPrice(priceUpper, 5)} {manuallyInverted ? currencyQuote?.symbol : currencyBase?.symbol} {' per '}{' '}
{manuallyInverted ? currencyBase?.symbol : currencyQuote?.symbol} {manuallyInverted ? currencyBase?.symbol : currencyQuote?.symbol}
</RangeText>{' '} </RangeText>{' '}
</RangeLineItem> </RangeLineItem>
......
...@@ -135,7 +135,7 @@ export const PositionPreview = ({ ...@@ -135,7 +135,7 @@ export const PositionPreview = ({
<TYPE.main <TYPE.main
textAlign="center" textAlign="center"
fontSize="12px" fontSize="12px"
>{` ${quoteCurrency.symbol}/${baseCurrency.symbol}`}</TYPE.main> >{` ${quoteCurrency.symbol} per ${baseCurrency.symbol}`}</TYPE.main>
<TYPE.small textAlign="center" color={theme.text3} style={{ marginTop: '4px' }}> <TYPE.small textAlign="center" color={theme.text3} style={{ marginTop: '4px' }}>
Your position will be 100% composed of {quoteCurrency?.symbol} at this price Your position will be 100% composed of {quoteCurrency?.symbol} at this price
</TYPE.small> </TYPE.small>
...@@ -149,7 +149,7 @@ export const PositionPreview = ({ ...@@ -149,7 +149,7 @@ export const PositionPreview = ({
<TYPE.main <TYPE.main
textAlign="center" textAlign="center"
fontSize="12px" fontSize="12px"
>{` ${quoteCurrency.symbol}/${baseCurrency.symbol}`}</TYPE.main> >{` ${quoteCurrency.symbol} per ${baseCurrency.symbol}`}</TYPE.main>
</AutoColumn> </AutoColumn>
</LightCard> </LightCard>
</AutoColumn> </AutoColumn>
......
...@@ -26,10 +26,10 @@ export default function RateToggle({ ...@@ -26,10 +26,10 @@ export default function RateToggle({
<div style={{ width: 'fit-content', display: 'flex', alignItems: 'center' }}> <div style={{ width: 'fit-content', display: 'flex', alignItems: 'center' }}>
<ToggleWrapper width="fit-content"> <ToggleWrapper width="fit-content">
<ToggleElement isActive={isSorted} fontSize="12px" onClick={handleRateToggle}> <ToggleElement isActive={isSorted} fontSize="12px" onClick={handleRateToggle}>
{isSorted ? currencyB.symbol + ' / ' + currencyA.symbol : currencyA.symbol + ' / ' + currencyB.symbol}{' '} {isSorted ? currencyA.symbol + ' price ' : currencyB.symbol + ' price '}
</ToggleElement> </ToggleElement>
<ToggleElement isActive={!isSorted} fontSize="12px" onClick={handleRateToggle}> <ToggleElement isActive={!isSorted} fontSize="12px" onClick={handleRateToggle}>
{isSorted ? currencyA.symbol + ' / ' + currencyB.symbol : currencyB.symbol + ' / ' + currencyA.symbol} {isSorted ? currencyB.symbol + ' price ' : currencyA.symbol + ' price '}
</ToggleElement> </ToggleElement>
</ToggleWrapper> </ToggleWrapper>
</div> </div>
......
...@@ -552,7 +552,7 @@ export default function AddLiquidity({ ...@@ -552,7 +552,7 @@ export default function AddLiquidity({
<TYPE.main fontSize={14} fontWeight={400} style={{ marginBottom: '.5rem', lineHeight: '125%' }}> <TYPE.main fontSize={14} fontWeight={400} style={{ marginBottom: '.5rem', lineHeight: '125%' }}>
Your liquidity will only earn fees when the market price of the pair is within your range.{' '} Your liquidity will only earn fees when the market price of the pair is within your range.{' '}
<ExternalLink <ExternalLink
href={'https://docs.uniswap.org/concepts/introduction/liquidity-user-guide'} href={'https://docs.uniswap.org/concepts/introduction/liquidity-user-guide#4-set-price-range'}
style={{ fontSize: '14px' }} style={{ fontSize: '14px' }}
> >
Need help picking a range? Need help picking a range?
...@@ -583,7 +583,7 @@ export default function AddLiquidity({ ...@@ -583,7 +583,7 @@ export default function AddLiquidity({
{invertPrice ? price.invert().toSignificant(5) : price.toSignificant(5)}{' '} {invertPrice ? price.invert().toSignificant(5) : price.toSignificant(5)}{' '}
</TYPE.body> </TYPE.body>
<TYPE.main fontWeight={500} textAlign="center" fontSize={12}> <TYPE.main fontWeight={500} textAlign="center" fontSize={12}>
{quoteCurrency?.symbol} {' / '} {quoteCurrency?.symbol} {' per '}
{baseCurrency.symbol} {baseCurrency.symbol}
</TYPE.main> </TYPE.main>
</AutoColumn> </AutoColumn>
......
...@@ -149,7 +149,7 @@ function CurrentPriceCard({ ...@@ -149,7 +149,7 @@ function CurrentPriceCard({
<TYPE.mediumHeader textAlign="center"> <TYPE.mediumHeader textAlign="center">
{(inverted ? pool.token1Price : pool.token0Price).toSignificant(5)}{' '} {(inverted ? pool.token1Price : pool.token0Price).toSignificant(5)}{' '}
</TYPE.mediumHeader> </TYPE.mediumHeader>
<ExtentsText>{currencyQuote?.symbol + ' / ' + currencyBase?.symbol}</ExtentsText> <ExtentsText>{currencyQuote?.symbol + ' per ' + currencyBase?.symbol}</ExtentsText>
</AutoColumn> </AutoColumn>
</LightCard> </LightCard>
) )
...@@ -420,7 +420,7 @@ export function PositionPage({ ...@@ -420,7 +420,7 @@ export function PositionPage({
borderRadius="12px" borderRadius="12px"
style={{ marginRight: '8px' }} style={{ marginRight: '8px' }}
> >
{t('Add Liquidity')} {t('Increase Liquidity')}
</ButtonGray> </ButtonGray>
) : null} ) : null}
{tokenId && !removed ? ( {tokenId && !removed ? (
...@@ -641,7 +641,7 @@ export function PositionPage({ ...@@ -641,7 +641,7 @@ export function PositionPage({
<AutoColumn gap="8px" justify="center"> <AutoColumn gap="8px" justify="center">
<ExtentsText>Min price</ExtentsText> <ExtentsText>Min price</ExtentsText>
<TYPE.mediumHeader textAlign="center">{priceLower?.toSignificant(5)}</TYPE.mediumHeader> <TYPE.mediumHeader textAlign="center">{priceLower?.toSignificant(5)}</TYPE.mediumHeader>
<ExtentsText> {currencyQuote?.symbol + ' / ' + currencyBase?.symbol}</ExtentsText> <ExtentsText> {currencyQuote?.symbol + ' per ' + currencyBase?.symbol}</ExtentsText>
{inRange && ( {inRange && (
<TYPE.small color={theme.text3}> <TYPE.small color={theme.text3}>
...@@ -656,7 +656,7 @@ export function PositionPage({ ...@@ -656,7 +656,7 @@ export function PositionPage({
<AutoColumn gap="8px" justify="center"> <AutoColumn gap="8px" justify="center">
<ExtentsText>Max price</ExtentsText> <ExtentsText>Max price</ExtentsText>
<TYPE.mediumHeader textAlign="center">{priceUpper?.toSignificant(5)}</TYPE.mediumHeader> <TYPE.mediumHeader textAlign="center">{priceUpper?.toSignificant(5)}</TYPE.mediumHeader>
<ExtentsText> {currencyQuote?.symbol + ' / ' + currencyBase?.symbol}</ExtentsText> <ExtentsText> {currencyQuote?.symbol + ' per ' + currencyBase?.symbol}</ExtentsText>
{inRange && ( {inRange && (
<TYPE.small color={theme.text3}> <TYPE.small color={theme.text3}>
......
import React, { useContext } from 'react' import React, { useContext } from 'react'
import { ButtonGray, ButtonPrimary } from 'components/Button' import { ButtonGray, ButtonOutlined, ButtonPrimary } from 'components/Button'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import { FlyoutAlignment, NewMenu } from 'components/Menu' import { FlyoutAlignment, NewMenu } from 'components/Menu'
import { SwapPoolTabs } from 'components/NavigationTabs' import { SwapPoolTabs } from 'components/NavigationTabs'
...@@ -217,14 +217,40 @@ export default function Pool() { ...@@ -217,14 +217,40 @@ export default function Pool() {
)} )}
</MainContentWrapper> </MainContentWrapper>
<RowFixed justify="center" style={{ width: '100%' }}> <RowFixed justify="center" style={{ width: '100%' }}>
<ButtonGray <ButtonOutlined
as={Link} as={Link}
to="/pool/v2" to="/pool/v2"
id="import-pool-link" id="import-pool-link"
style={{ padding: '8px 16px', borderRadius: '12px', width: 'fit-content' }} style={{
padding: '8px 16px',
margin: '0 4px',
borderRadius: '12px',
width: 'fit-content',
fontSize: '14px',
}}
> >
<TYPE.subHeader>{t('Looking for your V2 Liquidity')}?</TYPE.subHeader> <Layers size={14} style={{ marginRight: '8px' }} />
</ButtonGray>
{t('View V2 Liquidity')}
</ButtonOutlined>
{positions && positions.length > 0 && (
<ButtonOutlined
as={Link}
to="/migrate/v2"
id="import-pool-link"
style={{
padding: '8px 16px',
margin: '0 4px',
borderRadius: '12px',
width: 'fit-content',
fontSize: '14px',
}}
>
<ChevronsRight size={16} style={{ marginRight: '8px' }} />
{t('Migrate Liquidity')}
</ButtonOutlined>
)}
</RowFixed> </RowFixed>
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
......
...@@ -9,7 +9,9 @@ import { ExternalLink, TYPE, HideSmall } from '../../theme' ...@@ -9,7 +9,9 @@ import { ExternalLink, TYPE, HideSmall } from '../../theme'
import { Text } from 'rebass' import { Text } from 'rebass'
import Card from '../../components/Card' import Card from '../../components/Card'
import { RowBetween, RowFixed } from '../../components/Row' import { RowBetween, RowFixed } from '../../components/Row'
import { ButtonPrimary, ButtonSecondary } from '../../components/Button' import { ButtonPrimary, ButtonSecondary, ButtonOutlined } from '../../components/Button'
import { ChevronsRight } from 'react-feather'
import { AutoColumn } from '../../components/Column' import { AutoColumn } from '../../components/Column'
import { useActiveWeb3React } from '../../hooks' import { useActiveWeb3React } from '../../hooks'
...@@ -151,7 +153,7 @@ export default function Pool() { ...@@ -151,7 +153,7 @@ export default function Pool() {
</VoteCard> </VoteCard>
<AutoColumn gap="lg" justify="center"> <AutoColumn gap="lg" justify="center">
<AutoColumn gap="lg" style={{ width: '100%' }}> <AutoColumn gap="md" style={{ width: '100%' }}>
<TitleRow style={{ marginTop: '1rem' }} padding={'0'}> <TitleRow style={{ marginTop: '1rem' }} padding={'0'}>
<HideSmall> <HideSmall>
<TYPE.mediumHeader style={{ marginTop: '0.5rem', justifySelf: 'flex-start' }}> <TYPE.mediumHeader style={{ marginTop: '0.5rem', justifySelf: 'flex-start' }}>
...@@ -170,7 +172,7 @@ export default function Pool() { ...@@ -170,7 +172,7 @@ export default function Pool() {
to="/add/v2/ETH" to="/add/v2/ETH"
> >
<Text fontWeight={500} fontSize={16}> <Text fontWeight={500} fontSize={16}>
Add Liquidity Add V2 Liquidity
</Text> </Text>
</ResponsiveButtonPrimary> </ResponsiveButtonPrimary>
</ButtonRow> </ButtonRow>
...@@ -211,6 +213,23 @@ export default function Pool() { ...@@ -211,6 +213,23 @@ export default function Pool() {
/> />
) )
)} )}
<RowFixed justify="center" style={{ width: '100%' }}>
<ButtonOutlined
as={Link}
to="/migrate/v2"
id="import-pool-link"
style={{
padding: '8px 16px',
margin: '0 4px',
borderRadius: '12px',
width: 'fit-content',
fontSize: '14px',
}}
>
<ChevronsRight size={16} style={{ marginRight: '8px' }} />
Migrate Liquidity to V3
</ButtonOutlined>
</RowFixed>
</> </>
) : ( ) : (
<EmptyProposals> <EmptyProposals>
......
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