diff --git a/src/pages/Pool/MyPositionTableCard.tsx b/src/pages/Pool/MyPositionTableCard.tsx index 1881157e0..d5a26bcb4 100644 --- a/src/pages/Pool/MyPositionTableCard.tsx +++ b/src/pages/Pool/MyPositionTableCard.tsx @@ -13,6 +13,7 @@ import { EditedPosition } from '../MyLiquidity/useEditLiquidity'; import { guessInvertedOrder } from '../../lib/web3/utils/pairs'; import { useSimplePrice } from '../../lib/tokenPrices'; import { matchTokens } from '../../lib/web3/hooks/useTokens'; +import { useStake } from '../MyLiquidity/useStaking'; import TableCard from '../../components/cards/TableCard'; import ValueBar from '../../components/Table/ValueBar'; @@ -320,12 +321,19 @@ export function MyEditedPositionTableCard({ ); }, [poolValues]); + const [, sendStakeRequest] = useStake(); + const data = editedUserPosition - ? sortedPosition.map( - ( - { tickDiff0, tickDiff1, deposit, token0Context, token1Context }, - index - ) => { + ? sortedPosition.map((userPosition, index) => { + if (userPosition) { + const { + tickDiff0, + tickDiff1, + deposit, + token0Context, + token1Context, + stakeContext, + } = userPosition; const reserveA = !invertedTokenOrder ? tickDiff0.plus(token0Context?.userReserves || 0) : tickDiff1.plus(token1Context?.userReserves || 0); @@ -404,8 +412,13 @@ export function MyEditedPositionTableCard({ (reserveA.isZero() || reserveB.isZero()) && ( )} {(!tickDiff0.isZero() || !tickDiff1.isZero()) && ( @@ -457,7 +470,8 @@ export function MyEditedPositionTableCard({ ) : null; } - ) + return null; + }) : null; return ( diff --git a/src/pages/Pool/PoolManagement.tsx b/src/pages/Pool/PoolManagement.tsx index f3753210a..1df18f996 100644 --- a/src/pages/Pool/PoolManagement.tsx +++ b/src/pages/Pool/PoolManagement.tsx @@ -799,7 +799,14 @@ export default function PoolManagement({ const pairPoolDepositFilter = usePoolDepositFilterForPair( tokenA && tokenB ? [tokenA, tokenB] : ['', ''] ); - const userPositionsContext = useUserPositionsContext(pairPoolDepositFilter); + const userUnstakedContext = useUserPositionsContext(pairPoolDepositFilter); + const userStakedContext = useUserPositionsContext( + pairPoolDepositFilter, + true + ); + const userPositionsContext = useMemo(() => { + return [...userUnstakedContext, ...userStakedContext]; + }, [userStakedContext, userUnstakedContext]); const [{ isValidating: isValidatingEdit }, sendEditRequest] = useEditLiquidity();