Commit a1c4b97a authored by Noah Zinsmeister's avatar Noah Zinsmeister

Merge remote-tracking branch 'refs/remotes/origin/main'

parents f00adc75 e97939c5
...@@ -346,6 +346,13 @@ export default function AddLiquidity({ ...@@ -346,6 +346,13 @@ export default function AddLiquidity({
} }
}) })
}) })
.catch((error) => {
setAttemptingTxn(false)
// we only care if the error is something _other_ than the user rejected the tx
if (error?.code !== 4001) {
console.error(error)
}
})
} else { } else {
return return
} }
......
...@@ -15,7 +15,7 @@ import { TYPE } from 'theme' ...@@ -15,7 +15,7 @@ import { TYPE } from 'theme'
import Badge, { BadgeVariant } from 'components/Badge' import Badge, { BadgeVariant } from 'components/Badge'
import { basisPointsToPercent } from 'utils' import { basisPointsToPercent } from 'utils'
import { ButtonPrimary } from 'components/Button' import { ButtonPrimary } from 'components/Button'
import { DarkCard } from 'components/Card' import { DarkCard, DarkGreyCard } from 'components/Card'
import CurrencyLogo from 'components/CurrencyLogo' import CurrencyLogo from 'components/CurrencyLogo'
import { AlertTriangle } from 'react-feather' import { AlertTriangle } from 'react-feather'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
...@@ -73,6 +73,13 @@ const ActiveDot = styled.span` ...@@ -73,6 +73,13 @@ const ActiveDot = styled.span`
margin-right: 4px; margin-right: 4px;
` `
const DarkBadge = styled.div`
widthL fit-content;
border-radius: 8px;
background-color: ${({ theme }) => theme.bg0};
padding: 4px 6px;
`
export function PositionPage({ export function PositionPage({
match: { match: {
params: { positionIndex }, params: { positionIndex },
...@@ -111,10 +118,10 @@ export function PositionPage({ ...@@ -111,10 +118,10 @@ export function PositionPage({
return undefined return undefined
}, [liquidity, pool, tickLower, tickUpper]) }, [liquidity, pool, tickLower, tickUpper])
// const price0Lower = position ? position.token0PriceLower : undefined const price0Lower = position ? position.token0PriceLower : undefined
// const price0Upper = position ? position.token0PriceUpper : undefined const price0Upper = position ? position.token0PriceUpper : undefined
// const price1Lower = price0Upper ? price0Upper.invert() : undefined const price1Lower = price0Upper ? price0Upper.invert() : undefined
// const price1Upper = price0Lower ? price0Lower.invert() : undefined const price1Upper = price0Lower ? price0Lower.invert() : undefined
// check if price is within range // check if price is within range
const outOfRange: boolean = const outOfRange: boolean =
...@@ -204,6 +211,56 @@ export function PositionPage({ ...@@ -204,6 +211,56 @@ export function PositionPage({
<DarkCard> <DarkCard>
<AutoColumn gap="lg"> <AutoColumn gap="lg">
<TYPE.label>Position Limits</TYPE.label> <TYPE.label>Position Limits</TYPE.label>
<RowBetween>
<DarkGreyCard width="49%">
<AutoColumn gap="sm" justify="flex-start">
<TYPE.main>Lower Limit</TYPE.main>
<RowFixed>
<TYPE.label>{price0Lower?.toSignificant(4)}</TYPE.label>
<TYPE.label ml="10px">
{currency0?.symbol} / {currency1?.symbol}
</TYPE.label>
</RowFixed>
<RowFixed>
<TYPE.label>{price1Lower?.toSignificant(4)}</TYPE.label>
<TYPE.label ml="10px">
{currency1?.symbol} / {currency0?.symbol}
</TYPE.label>
</RowFixed>
<DarkBadge>
<RowFixed>
<TYPE.label mr="6px">100%</TYPE.label>
<CurrencyLogo currency={currency0} size="16px" />
<TYPE.label ml="4px">{currency0?.symbol}</TYPE.label>
</RowFixed>
</DarkBadge>
</AutoColumn>
</DarkGreyCard>
<DarkGreyCard width="49%">
<AutoColumn gap="sm" justify="flex-start">
<TYPE.main>Lower Limit</TYPE.main>
<RowFixed>
<TYPE.label>{price0Upper?.toSignificant(4)}</TYPE.label>
<TYPE.label ml="10px">
{currency0?.symbol} / {currency1?.symbol}
</TYPE.label>
</RowFixed>
<RowFixed>
<TYPE.label>{price1Upper?.toSignificant(4)}</TYPE.label>
<TYPE.label ml="10px">
{currency1?.symbol} / {currency0?.symbol}
</TYPE.label>
</RowFixed>
<DarkBadge>
<RowFixed>
<TYPE.label mr="6px">100%</TYPE.label>
<CurrencyLogo currency={currency1} size="16px" />
<TYPE.label ml="4px">{currency1?.symbol}</TYPE.label>
</RowFixed>
</DarkBadge>
</AutoColumn>
</DarkGreyCard>
</RowBetween>
</AutoColumn> </AutoColumn>
</DarkCard> </DarkCard>
</AutoColumn> </AutoColumn>
......
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