Commit 71787460 authored by Noah Zinsmeister's avatar Noah Zinsmeister

highlight 100% position composition

parent 2efe8250
...@@ -222,14 +222,9 @@ export function PositionPage({ ...@@ -222,14 +222,9 @@ export function PositionPage({
const currencyBase = inverted ? currency1 : currency0 const currencyBase = inverted ? currency1 : currency0
// check if price is within range // check if price is within range
const inRange: boolean = const below = pool && typeof tickLower === 'number' ? pool.tickCurrent < tickLower : undefined
pool && typeof tickLower === 'number' && typeof tickUpper === 'number' const above = pool && typeof tickUpper === 'number' ? pool.tickCurrent >= tickUpper : undefined
? pool.tickCurrent >= tickLower && pool.tickCurrent < tickUpper const inRange: boolean = typeof below === 'boolean' && typeof above === 'boolean' ? !below && !above : false
: false
// keep will need to be able to draw the range visualization
// const below = pool && typeof tickLower === 'number' ? pool.tickCurrent < tickLower : false
// const above = pool && typeof tickUpper === 'number' ? pool.tickCurrent >= tickUpper : false
const ratio = useMemo(() => { const ratio = useMemo(() => {
return priceLower && pool && priceUpper return priceLower && pool && priceUpper
...@@ -616,10 +611,17 @@ export function PositionPage({ ...@@ -616,10 +611,17 @@ export function PositionPage({
{priceLower?.toSignificant(4)} {currencyQuote?.symbol} {priceLower?.toSignificant(4)} {currencyQuote?.symbol}
</TYPE.label> </TYPE.label>
</RowFixed> </RowFixed>
<TYPE.subHeader color={theme.text3} textAlign="center"> {(inverted ? below : above) ? (
Your position will be <CurrencyLogo currency={inverted ? currency1 : currency0} size="12px" /> 100%{' '} <TYPE.subHeader color={theme.text3} textAlign="center">
{inverted ? currency1?.symbol : currency0?.symbol} at this price Your position will be <CurrencyLogo currency={inverted ? currency1 : currency0} size="12px" />{' '}
</TYPE.subHeader> 100% {inverted ? currency1?.symbol : currency0?.symbol} at this price
</TYPE.subHeader>
) : (
<TYPE.label textAlign="center">
Your position is <CurrencyLogo currency={inverted ? currency1 : currency0} size="12px" /> 100%{' '}
{inverted ? currency1?.symbol : currency0?.symbol}
</TYPE.label>
)}
</AutoColumn> </AutoColumn>
</LightCard> </LightCard>
...@@ -632,10 +634,17 @@ export function PositionPage({ ...@@ -632,10 +634,17 @@ export function PositionPage({
{priceUpper?.toSignificant(4)} {currencyQuote?.symbol} {priceUpper?.toSignificant(4)} {currencyQuote?.symbol}
</TYPE.label> </TYPE.label>
</RowFixed> </RowFixed>
<TYPE.subHeader color={theme.text3} textAlign="center"> {(inverted ? above : below) ? (
Your position will be <CurrencyLogo currency={inverted ? currency0 : currency1} size="12px" /> 100%{' '} <TYPE.subHeader color={theme.text3} textAlign="center">
{inverted ? currency0?.symbol : currency1?.symbol} at this price Your position will be <CurrencyLogo currency={inverted ? currency0 : currency1} size="12px" />{' '}
</TYPE.subHeader> 100% {inverted ? currency0?.symbol : currency1?.symbol} at this price
</TYPE.subHeader>
) : (
<TYPE.label textAlign="center">
Your position is <CurrencyLogo currency={inverted ? currency0 : currency1} size="12px" /> 100%{' '}
{inverted ? currency0?.symbol : currency1?.symbol}
</TYPE.label>
)}
</AutoColumn> </AutoColumn>
</LightCard> </LightCard>
</RowBetween> </RowBetween>
......
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