diff --git a/apps/web/src/views/PoolDetail/components/PoolInfo.tsx b/apps/web/src/views/PoolDetail/components/PoolInfo.tsx index 1cf8a127d8f04..a72bdd8f5dda9 100644 --- a/apps/web/src/views/PoolDetail/components/PoolInfo.tsx +++ b/apps/web/src/views/PoolDetail/components/PoolInfo.tsx @@ -14,6 +14,7 @@ import { MyPositions } from './MyPositions' import { PoolCharts } from './PoolCharts' import { PoolCurrencies } from './PoolCurrencies' import { PoolStatus } from './PoolStatus' +import { PoolTvlWarning } from './PoolTvlWarning' import { Transactions } from './Transactions/Transactions' const Header = styled.div` @@ -112,6 +113,7 @@ export const PoolInfo = () => { + diff --git a/apps/web/src/views/PoolDetail/components/PoolTvlWarning.tsx b/apps/web/src/views/PoolDetail/components/PoolTvlWarning.tsx new file mode 100644 index 0000000000000..b87df3c30c18f --- /dev/null +++ b/apps/web/src/views/PoolDetail/components/PoolTvlWarning.tsx @@ -0,0 +1,36 @@ +import { getChainName } from '@pancakeswap/chains' +import { Protocol } from '@pancakeswap/farms' +import { useTranslation } from '@pancakeswap/localization' +import { Message, MessageText, Text } from '@pancakeswap/uikit' +import { PoolInfo } from 'state/farmsV4/state/type' +import { TextLink } from 'views/Ifos/components/IfoCardStyles' +import { useRouterQuery } from '../hooks/useRouterQuery' + +const ONE_BILLION = 1_000_000_000 +export const PoolTvlWarning = ({ poolInfo }: { poolInfo: PoolInfo }) => { + const { t } = useTranslation() + const { id, chainId } = useRouterQuery() + const tvlUsd = parseFloat(poolInfo.tvlUsd ?? '0') + const { protocol } = poolInfo + const chain = getChainName(chainId) + + const version = `${protocol === Protocol.V3 ? '/v3/' : ''}` + const stableSwap = `${protocol === Protocol.STABLE ? '?type=stableSwap' : ''}` + const link = `https://pancakeswap.finance/info/${version}${chain}/pairs/${id}${stableSwap}` + if (tvlUsd < ONE_BILLION) { + return null + } + return ( + + + + {t('TVL and APR data may not be reflected correctly due to technical limitation, please refer to')}{' '} + + {t('info page')} + {' '} + {t('for accurate values')} + + + + ) +} diff --git a/packages/localization/src/config/translations.json b/packages/localization/src/config/translations.json index 447ade9c6a011..874eda0bab492 100644 --- a/packages/localization/src/config/translations.json +++ b/packages/localization/src/config/translations.json @@ -3582,5 +3582,8 @@ "veCake Balance": "veCake Balance", "You cast your vote! Please wait until the voting ends to see the end results.": "You cast your vote! Please wait until the voting ends to see the end results.", "Not enough veCAKE": "Not enough veCAKE", - "Enter the votes to cast": "Enter the votes to cast" + "Enter the votes to cast": "Enter the votes to cast", + "TVL and APR data may not be reflected correctly due to technical limitation, please refer to": "TVL and APR data may not be reflected correctly due to technical limitation, please refer to", + "info page": "info page", + "for accurate values": "for accurate values" }