@@ -4,16 +4,16 @@ import { useTheme } from '@material-ui/core/styles';
44import { ChevronDown , ChevronUp } from 'react-feather' ;
55import { Pair } from '@uniswap/sdk' ;
66import { unwrappedToken } from 'utils/wrappedCurrency' ;
7- import { useStakingInfo , getBulkPairData } from 'state/stake/hooks' ;
7+ import {
8+ useStakingInfo ,
9+ getBulkPairData ,
10+ useDualStakingInfo ,
11+ } from 'state/stake/hooks' ;
812import { DoubleCurrencyLogo } from 'components' ;
913import { getAPYWithFee , getOneYearFee } from 'utils' ;
1014import PoolPositionCardDetails from './PoolPositionCardDetails' ;
1115
12- interface PoolPositionCardProps {
13- pair : Pair ;
14- }
15-
16- const PoolPositionCard : React . FC < PoolPositionCardProps > = ( { pair } ) => {
16+ const PoolPositionCard : React . FC < { pair : Pair } > = ( { pair } ) => {
1717 const [ bulkPairData , setBulkPairData ] = useState < any > ( null ) ;
1818 const { palette, breakpoints } = useTheme ( ) ;
1919 const isMobile = useMediaQuery ( breakpoints . down ( 'xs' ) ) ;
@@ -22,15 +22,21 @@ const PoolPositionCard: React.FC<PoolPositionCardProps> = ({ pair }) => {
2222 const currency1 = unwrappedToken ( pair . token1 ) ;
2323
2424 const stakingInfos = useStakingInfo ( pair ) ;
25+ const dualStakingInfos = useDualStakingInfo ( pair ) ;
2526 const stakingInfo = useMemo (
26- ( ) => ( stakingInfos && stakingInfos . length > 0 ? stakingInfos [ 0 ] : null ) ,
27- [ stakingInfos ] ,
27+ ( ) =>
28+ stakingInfos && stakingInfos . length > 0
29+ ? stakingInfos [ 0 ]
30+ : dualStakingInfos && dualStakingInfos . length > 0
31+ ? dualStakingInfos [ 0 ]
32+ : null ,
33+ [ stakingInfos , dualStakingInfos ] ,
2834 ) ;
2935
30- const pairId = stakingInfo ? stakingInfo . pair : null ;
36+ const pairId = pair . liquidityToken . address ;
3137
3238 useEffect ( ( ) => {
33- const pairLists = pairId ? [ pairId ] : [ ] ;
39+ const pairLists = [ pairId ] ;
3440 getBulkPairData ( pairLists ) . then ( ( data ) => setBulkPairData ( data ) ) ;
3541 return ( ) => setBulkPairData ( null ) ;
3642 } , [ pairId ] ) ;
@@ -101,7 +107,7 @@ const PoolPositionCard: React.FC<PoolPositionCardProps> = ({ pair }) => {
101107 </ Box >
102108 </ Box >
103109
104- { showMore && < PoolPositionCardDetails pair = { pair } pairId = { pairId } /> }
110+ { showMore && < PoolPositionCardDetails pair = { pair } /> }
105111 { stakingInfo && apyWithFee && (
106112 < Box bgcolor = '#404557' paddingY = { 0.75 } paddingX = { isMobile ? 2 : 3 } >
107113 < Typography variant = 'body2' >
0 commit comments