Skip to content

Commit

Permalink
revert env
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Jul 25, 2023
1 parent c2cc1a1 commit 952f35e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/IncreaseLiquidity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ export default function IncreaseLiquidity() {
tokenId ? BigNumber.from(tokenId) : undefined,
)

const removed = existingPositionDetails?.liquidity?.eq(0)

const owner = useSingleCallResult(!!tokenId ? positionManager : null, 'ownerOf', [tokenId]).result?.[0]

const ownsNFT = owner === account || existingPositionDetails?.operator === account
const ownByFarm = isEVM
? (networkInfo as EVMNetworkInfo).elastic.farms.flat().includes(isAddressString(chainId, owner)) ||
(networkInfo as EVMNetworkInfo).elastic.farmV2S?.map(item => item.toLowerCase()).includes(owner.toLowerCase())
(networkInfo as EVMNetworkInfo).elastic.farmV2S?.map(item => item.toLowerCase()).includes(owner?.toLowerCase())
: false

const { position: existingPosition } = useProAmmDerivedPositionInfo(existingPositionDetails)
Expand Down Expand Up @@ -499,9 +501,11 @@ export default function IncreaseLiquidity() {

<BlackCard style={{ borderRadius: '1rem', padding: '1rem' }}>
<Flex alignItems="center" sx={{ gap: '4px' }}>
<TokenId color={outOfRange ? theme.warning : theme.primary}>#{tokenId?.toString()}</TokenId>
<TokenId color={removed ? theme.red : outOfRange ? theme.warning : theme.primary}>
#{tokenId?.toString()}
</TokenId>
{/* dont show removed when increasing liquidity*/}
<RangeBadge removed={false} inRange={!outOfRange} hideText size={14} />
<RangeBadge removed={removed} inRange={!outOfRange} hideText size={14} />
</Flex>

<Flex
Expand Down

0 comments on commit 952f35e

Please sign in to comment.