Skip to content

Commit

Permalink
issue #27: hidden position has value < 0.0001
Browse files Browse the repository at this point in the history
  • Loading branch information
blackskin18 committed Jun 6, 2023
1 parent 7a13d67 commit 092bcd2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Components/Positions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ import './style.scss'
import { useCurrentPool } from '../../state/currentPool/hooks/useCurrentPool'
import { useWalletBalance } from '../../state/wallet/hooks/useBalances'
import { POOL_IDS } from '../../utils/constant'
import { bn, formatFloat, numberToWei, shortenAddressString, weiToNumber } from '../../utils/helpers'
import { formatFloat, shortenAddressString, weiToNumber } from '../../utils/helpers'
import { useListTokens } from '../../state/token/hook'
import { PoolType } from '../../state/resources/type'
import { Button } from '../ui/Button'
import formatLocalisedCompactNumber, { formatWeiToDisplayNumber } from '../../utils/formatBalance'
import { BigNumber } from 'ethers'
import { Text, TextGrey, TextLink } from '../ui/Text'
import { Text, TextLink } from '../ui/Text'
import { useConfigs } from '../../state/config/useConfigs'
import { TokenIcon } from '../ui/TokenIcon'
import { TokenSymbol } from '../ui/TokenSymbol'
import { ClosePosition } from '../ClosePositionModal'
import { useTokenValue } from '../SwapBox/hooks/useTokenValue'

const MIN_POSITON_VALUE_TO_DISPLAY = 0.0001

type Position = {
poolAddress: string
token: string
Expand Down Expand Up @@ -79,6 +81,9 @@ export const Positions = () => {
position.token,
weiToNumber(position.balance, tokens[position.token]?.decimal || 18)
)
if (Number(value) < MIN_POSITON_VALUE_TO_DISPLAY) {
return ''
}

return <tr key={key}>
<td className='hidden-on-phone'>
Expand Down

0 comments on commit 092bcd2

Please sign in to comment.