diff --git a/src/avs/AVSDetailsTVLTab.jsx b/src/avs/AVSDetailsTVLTab.jsx index 349db8e2..4204389c 100644 --- a/src/avs/AVSDetailsTVLTab.jsx +++ b/src/avs/AVSDetailsTVLTab.jsx @@ -3,7 +3,7 @@ import { EIGEN_STRATEGY, lstStrategyAssetMapping } from '../shared/strategies'; -import { formatETH, formatNumber, formatUSD } from '../shared/formatters'; +import { formatETH, formatUSD } from '../shared/formatters'; import { handleServiceError, reduceState } from '../shared/helpers'; import { Skeleton, @@ -13,14 +13,12 @@ import { TableCell, TableColumn, TableHeader, - TableRow, - Tooltip + TableRow } from '@nextui-org/react'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo } from 'react'; import ErrorMessage from '../shared/ErrorMessage'; import { ParentSize } from '@visx/responsive'; import ThirdPartyLogo from '../shared/ThirdPartyLogo'; -import { tooltip } from '../shared/slots'; import TVLTabLineChart from './charts/TVLTabLineChart'; import TVLTabTreemap from './charts/TVLTabTreemap'; import { useMutativeReducer } from 'use-mutative'; @@ -168,7 +166,7 @@ const tokens = { function TokensBreakdownList({ avsError, totalTokens, isAVSLoading, ethRate }) { const sortedTotalTokens = useMemo(() => { - const arr = Object.entries(totalTokens).filter(t => t[0] !== 'eigen'); + const arr = Object.entries(totalTokens); arr.sort((a, b) => b[1] - a[1]); return arr; }, [totalTokens]); @@ -225,7 +223,7 @@ function TokensBreakdownList({ avsError, totalTokens, isAVSLoading, ethRate }) {
{tokens[key].name} @@ -247,34 +245,6 @@ function TokensBreakdownList({ avsError, totalTokens, isAVSLoading, ethRate }) { ))} - {!isAVSLoading && ( - - -
- - - {tokens['eigen'].name} - - - {tokens['eigen'].symbol} - - {N/A} -
-
- -
- - -
- {`${formatNumber(totalTokens['eigen'], compact)} EIGEN`} -
-
-
-
- )} ); @@ -290,7 +260,13 @@ function LSTBreakdownList({ avsError, lst, ethRate, isAVSLoading }) { const arr = Object.entries(lst); arr.sort((a, b) => Number(b[1]) - Number(a[1])); - return arr.filter(([strategy]) => !exclude.has(strategy)); + // TODO(vincenthongzy): Stop-gap measure to make sure + // permissionless tokens do not distrupt UI. + // We should revert and handle it properly soon. + return arr.filter( + ([strategy]) => + !exclude.has(strategy) && strategy in lstStrategyAssetMapping + ); }, [avsError, lst, isAVSLoading]); const compact = !useTailwindBreakpoint('md'); @@ -339,7 +315,7 @@ function LSTBreakdownList({ avsError, lst, ethRate, isAVSLoading }) {
{lstStrategyAssetMapping[key]?.name} @@ -364,37 +340,3 @@ function LSTBreakdownList({ avsError, lst, ethRate, isAVSLoading }) { ); } - -function EigenDisclaimer() { - const [isOpen, setOpen] = useState(false); - - return ( -
- N/A - - EIGEN is currently not listed on any exchanges so we are unable to - get its USD value. Information will be updated when the token is - available on centralized/decentralized exchanges. - - } - isOpen={isOpen} - onOpenChange={open => setOpen(open)} - placement="top" - showArrow={true} - > - setOpen(!isOpen)} - style={{ - fontVariationSettings: `'FILL' 0` - }} - > - info - - -
- ); -} diff --git a/src/avs/charts/TVLTabTreemap.jsx b/src/avs/charts/TVLTabTreemap.jsx index 917f3c6a..65e890af 100644 --- a/src/avs/charts/TVLTabTreemap.jsx +++ b/src/avs/charts/TVLTabTreemap.jsx @@ -43,8 +43,8 @@ export default function TVLTabTreemap({ width, height, ethRate, lst }) { return Object.entries(lst) .filter(([strategy]) => !filters.has(strategy)) .map(([strategy, value]) => ({ - name: allStrategyAssetMapping[strategy].name, - symbol: allStrategyAssetMapping[strategy].symbol, + name: allStrategyAssetMapping[strategy]?.name, + symbol: allStrategyAssetMapping[strategy]?.symbol, value: Number(value) })); }, [lst, state.useAllStrategies]); diff --git a/src/lst/LST.jsx b/src/lst/LST.jsx index bcfead3f..ad985c10 100644 --- a/src/lst/LST.jsx +++ b/src/lst/LST.jsx @@ -1,3 +1,8 @@ +import { + BEACON_STRATEGY, + EIGEN_STRATEGY, + lstStrategyAssetMapping +} from '../shared/strategies'; import { handleServiceError, reduceState } from '../shared/helpers'; import ErrorMessage from '../shared/ErrorMessage'; import LSTDistribution from './LSTDistribution'; @@ -39,8 +44,17 @@ export default function LST() { return 0; }); + const exclude = new Set([EIGEN_STRATEGY, BEACON_STRATEGY]); + + // TODO(vincenthongzy): Stop-gap measure to make sure + // permissionless tokens do not distrupt UI. + // We should revert and handle it properly soon. dispatch({ - rankings, + rankings: rankings.filter( + ranking => + !exclude.has(ranking.address) && + ranking.address in lstStrategyAssetMapping + ), ethRate: current.rate, lst: data, isLoadingLST: false diff --git a/src/lst/LSTList.jsx b/src/lst/LSTList.jsx index 414d7dc4..c91f2cca 100644 --- a/src/lst/LSTList.jsx +++ b/src/lst/LSTList.jsx @@ -48,14 +48,14 @@ export default function LSTList({ data, latestRate }) {
- {lstStrategyAssetMapping[address].name} + {lstStrategyAssetMapping[address]?.name} - {lstStrategyAssetMapping[address].symbol} + {lstStrategyAssetMapping[address]?.symbol}
diff --git a/src/operators/OperatorDetails.jsx b/src/operators/OperatorDetails.jsx index ae01bece..628ebf8c 100644 --- a/src/operators/OperatorDetails.jsx +++ b/src/operators/OperatorDetails.jsx @@ -3,7 +3,7 @@ import { EIGEN_STRATEGY, lstStrategyAssetMapping } from '../shared/strategies'; -import { formatETH, formatNumber, formatUSD } from '../shared/formatters'; +import { formatETH, formatUSD } from '../shared/formatters'; import { handleServiceError, reduceState } from '../shared/helpers'; import { Link, @@ -16,10 +16,9 @@ import { TableColumn, TableHeader, TableRow, - Tabs, - Tooltip + Tabs } from '@nextui-org/react'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo } from 'react'; import { useLocation, useNavigate, useParams } from 'react-router-dom'; import CopyButton from '../shared/CopyButton'; import ErrorMessage from '../shared/ErrorMessage'; @@ -28,7 +27,6 @@ import OperatorRestakersLineChart from './charts/OperatorRestakersLineChart'; import OperatorTVLLineChart from './charts/OperatorTVLLineChart'; import { ParentSize } from '@visx/responsive'; import ThirdPartyLogo from '../shared/ThirdPartyLogo'; -import { tooltip } from '../shared/slots'; import { truncateAddress } from '../shared/helpers'; import TVLTabTreemap from '../avs/charts/TVLTabTreemap'; import { useMutativeReducer } from 'use-mutative'; @@ -372,7 +370,7 @@ function TokensBreakdownList({ ethRate }) { const sortedTotalTokens = useMemo(() => { - const arr = Object.entries(totalTokens).filter(t => t[0] !== 'eigen'); + const arr = Object.entries(totalTokens); arr.sort((a, b) => b[1] - a[1]); return arr; }, [totalTokens]); @@ -429,7 +427,7 @@ function TokensBreakdownList({
{tokens[key].name} @@ -452,33 +450,6 @@ function TokensBreakdownList({ ))} - {!isOperatorLoading && ( - - -
- - - {tokens['eigen'].name} - - - {tokens['eigen'].symbol} - - {N/A} -
-
- -
- -
- {`${formatNumber(totalTokens['eigen'], compact)} EIGEN`} -
-
-
-
- )} ); @@ -494,7 +465,14 @@ function LSTBreakdownList({ operatorError, lst, ethRate, isOperatorLoading }) { const arr = Object.entries(lst); arr.sort((a, b) => Number(b[1]) - Number(a[1])); - return arr.filter(([strategy]) => !exclude.has(strategy)); + + // TODO(vincenthongzy): Stop-gap measure to make sure + // permissionless tokens do not distrupt UI. + // We should revert and handle it properly soon. + return arr.filter( + ([strategy]) => + !exclude.has(strategy) && strategy in lstStrategyAssetMapping + ); }, [operatorError, lst, isOperatorLoading]); const compact = !useTailwindBreakpoint('md'); @@ -553,7 +531,7 @@ function LSTBreakdownList({ operatorError, lst, ethRate, isOperatorLoading }) {
{lstStrategyAssetMapping[key]?.name} @@ -579,40 +557,6 @@ function LSTBreakdownList({ operatorError, lst, ethRate, isOperatorLoading }) { ); } -function EigenDisclaimer() { - const [isOpen, setOpen] = useState(false); - - return ( -
- N/A - - EIGEN is currently not listed on any exchanges so we are unable to - get its USD value. Information will be updated when the token is - available on centralized/decentralized exchanges. - - } - isOpen={isOpen} - onOpenChange={open => setOpen(open)} - placement="top" - showArrow={true} - > - setOpen(!isOpen)} - style={{ - fontVariationSettings: `'FILL' 0` - }} - > - info - - -
- ); -} - function AVSList({ list, error, isLoading }) { const navigate = useNavigate();