diff --git a/src/avs/AVSDetails.jsx b/src/avs/AVSDetails.jsx index 429ac803..50161d5e 100644 --- a/src/avs/AVSDetails.jsx +++ b/src/avs/AVSDetails.jsx @@ -28,7 +28,7 @@ export default function AVSDetails() { const { avsService } = useServices(); const [state, dispatch] = useMutativeReducer(reduceState, { avsDetails: null, - timelineTab: '7days', + timelineTab: 'all', lstDistributionData: [], eigenTVL: BigInt(0), beaconTVL: BigInt(0), diff --git a/src/avs/AVSTotalValueOvertime.jsx b/src/avs/AVSTotalValueOvertime.jsx index 1f5e271f..f6de0708 100644 --- a/src/avs/AVSTotalValueOvertime.jsx +++ b/src/avs/AVSTotalValueOvertime.jsx @@ -9,7 +9,7 @@ import AVSTotalValueOvertimeChart from './AVSTotalValueOvertimeChart'; const AVSTotalValueOvertime = ({ avsAddress }) => { const [state, dispatch] = useMutativeReducer(reduceState, { - timelineTab: '7days', + timelineTab: 'all', avsTotalValueOvertimeData: null }); const { avsService } = useServices(); diff --git a/src/avs/Operators.jsx b/src/avs/Operators.jsx index 0bb3626a..971543b6 100644 --- a/src/avs/Operators.jsx +++ b/src/avs/Operators.jsx @@ -1,7 +1,7 @@ import { Card, Input, Skeleton } from '@nextui-org/react'; import { SearchIcon } from '@nextui-org/shared-icons'; import { useEffect } from 'react'; -import { useSearchParams } from 'react-router-dom'; +import { Link, useSearchParams } from 'react-router-dom'; import { useMutativeReducer } from 'use-mutative'; import { useServices } from '../@services/ServiceContext'; import { reduceState } from '../shared/helpers'; @@ -114,7 +114,8 @@ export default function Operators({ avsAddress, totalTVL }) { filteredOperators.map( (operator, i) => operator.metadata && ( -
@@ -143,7 +144,7 @@ export default function Operators({ avsAddress, totalTVL }) { {formatNumber(operator.strategiesTotal, compact)} ETH
- + ) ) ) : ( diff --git a/src/avs/OperatorsOvertime.jsx b/src/avs/OperatorsOvertime.jsx index 60287db0..ea1ce25c 100644 --- a/src/avs/OperatorsOvertime.jsx +++ b/src/avs/OperatorsOvertime.jsx @@ -9,7 +9,7 @@ import OperatorsOvertimeChart from './OperatorsOvertimeChart'; const OperatorsOvertime = ({ avsAddress }) => { const [state, dispatch] = useMutativeReducer(reduceState, { - timelineTab: '7days', + timelineTab: 'all', operatorsOvertimeData: null }); const { avsService } = useServices(); diff --git a/src/home/EigenLayerTVLOvertime.jsx b/src/home/EigenLayerTVLOvertime.jsx index f2119f4a..1fba3879 100644 --- a/src/home/EigenLayerTVLOvertime.jsx +++ b/src/home/EigenLayerTVLOvertime.jsx @@ -7,7 +7,7 @@ import EigenLayerTVLOvertimeChart from './EigenLayerTVLOvertimeChart'; const EigenLayerTVLOvertime = ({ eigenTVLData }) => { const [state, dispatch] = useMutativeReducer(reduceState, { - timelineTab: '7days' + timelineTab: 'all' }); const getDataByRange = useCallback(() => { diff --git a/src/operators/LSTDistribution.jsx b/src/operators/LSTDistribution.jsx index 7abdf47e..06224cd8 100644 --- a/src/operators/LSTDistribution.jsx +++ b/src/operators/LSTDistribution.jsx @@ -39,7 +39,7 @@ const LSTDistribution = ({ strategies, operatorTVL }) => { lstDistribution: [] }); const [active, setActive] = useState(null); - const width = 200; + const width = 300; const half = width / 2; const assetFormatter = new Intl.NumberFormat('en-US', { @@ -99,7 +99,7 @@ const LSTDistribution = ({ strategies, operatorTVL }) => { return (
-
+
{state.lstDistribution.map((strategy, i) => ( { pieValue={data => data.tokensInETH} outerRadius={half} innerRadius={({ data }) => { - const size = 30; + const size = 50; return half - size; }} cornerRadius={0} diff --git a/src/operators/OperatorDetails.jsx b/src/operators/OperatorDetails.jsx index 39dcdb47..0f393a1f 100644 --- a/src/operators/OperatorDetails.jsx +++ b/src/operators/OperatorDetails.jsx @@ -15,7 +15,7 @@ const OperatorDetails = () => { const { operatorService } = useServices(); const [state, dispatch] = useMutativeReducer(reduceState, { operatorTVL: 0, - timelineTab: '7days' + timelineTab: 'all' }); const calculateTVL = strategies => { @@ -57,35 +57,38 @@ const OperatorDetails = () => {
- {state.operator?.metadata?.name} + {state.operator?.metadata?.name ?? 'Unknown'}
{state.operator?.metadata?.description}
-
+
- TVL - + TVL + {state.operator?.strategies && `${assetFormatter.format(formatEther(state.operatorTVL.toString()))} ETH`}
- +
- AVS Subscribed - {state.operator?.avs.length} + + AVS Subscribed + + + {state.operator?.avs.length} +
- +
- Stakers - {state.operator?.stakerCount} -
- -
- Uptime - TODO + + Restakers + + + {state.operator?.stakerCount} +
@@ -99,17 +102,6 @@ const OperatorDetails = () => { />
- - - Restaking Leaderboard - - - - -
{ const { operatorService } = useServices(); const [state, dispatch] = useMutativeReducer(reduceState, { - timelineTab: '7days', + timelineTab: 'all', tvlOvertimeData: [] }); @@ -54,7 +54,7 @@ const OperatorTVLOverTime = ({ opAddress, currentTVL }) => {
-
TVL
+
TVL
{currentTVL} ETH diff --git a/src/operators/OperatorsList.jsx b/src/operators/OperatorsList.jsx index 97008642..2ec8e47b 100644 --- a/src/operators/OperatorsList.jsx +++ b/src/operators/OperatorsList.jsx @@ -4,15 +4,19 @@ import { useMutativeReducer } from 'use-mutative'; import { reduceState } from '../shared/helpers'; import { Link, useSearchParams } from 'react-router-dom'; import Pagination from '../shared/Pagination'; -import { Input } from '@nextui-org/react'; +import { Input, Skeleton } from '@nextui-org/react'; +import { formatNumber } from '../utils'; +import { useTailwindBreakpoint } from '../shared/useTailwindBreakpoint'; import useDebounce from '../shared/hooks/useDebounce'; const OperatorsList = () => { const { operatorService } = useServices(); const [searchParams, setSearchParams] = useSearchParams(); + const compact = !useTailwindBreakpoint('md'); const [state, dispatch] = useMutativeReducer(reduceState, { searchTerm: searchParams.get('search'), - searchTriggered: false + searchTriggered: false, + error: null }); const debouncedSearchTerm = useDebounce(state.searchTerm, 300); @@ -21,10 +25,14 @@ const OperatorsList = () => { const data = await operatorService.getAll(pageIndex - 1, search); dispatch({ operators: data.results, + isFetchingOperatorData: false, totalPages: Math.ceil(data.totalCount / 10) }); } catch { - // TODO: handle error + dispatch({ + error: 'Failed to fetch Operator data', + isFetchingOperatorData: false + }); } }; @@ -107,42 +115,84 @@ const OperatorsList = () => {
-
+
Operators - Servicing AVS Restakers TVL
- {state.operators?.map((op, i) => ( - -
- - {op.metadata?.name} - 7 AVS - {op.stakerCount} - -
ETH {assetFormatter.format(op.strategiesTotal)}
-
- USD {assetFormatter.format(op.strategiesTotal)} -
-
- - ))} + {state.isFetchingOperatorData ? ( + + ) : ( + <> + {state.operators?.map((op, i) => ( + +
+ {(searchParams.get('page') - 1) * 10 + i + 1} +
+ {op.metadata?.logo ? ( + + ) : ( + + warning + + )} + + {op.metadata?.name ?? 'Unknown'} + + + {formatNumber(op.stakerCount, compact)} + + +
ETH {assetFormatter.format(op.strategiesTotal)}
+
+ USD {assetFormatter.format(op.strategiesTotal)} +
+
+ + ))} - + + + )}
); }; export default OperatorsList; + +const OperatorListSkeleton = () => { + return ( +
+ {[...Array(10)].map((item, i) => ( +
+
+ +
+
+ +
{' '} +
+ +
+
+ ))} +
+ ); +}; diff --git a/src/operators/RestakersTrend.jsx b/src/operators/RestakersTrend.jsx index 94ad03f5..fc1de877 100644 --- a/src/operators/RestakersTrend.jsx +++ b/src/operators/RestakersTrend.jsx @@ -6,12 +6,13 @@ import { reduceState } from '../shared/helpers'; import { ParentSize } from '@visx/responsive'; import RestakersTrendChart from './RestakersTrendChart'; import { useServices } from '../@services/ServiceContext'; +import { assetFormatter } from '../utils'; const RestakersTrend = ({ opAddress }) => { const { operatorService } = useServices(); const [state, dispatch] = useMutativeReducer(reduceState, { restakerTrend: [], - timelineTab: '7days' + timelineTab: 'all' }); const getDataByRange = useCallback(() => { @@ -45,13 +46,17 @@ const RestakersTrend = ({ opAddress }) => {
- Restaker Trend + Restaker Trend
Total Restakers:{' '} - {state.restakerTrend[state.restakerTrend.length - 1] - ?.restakers ?? 'N/A'} + {state.restakerTrend[state.restakerTrend.length - 1]?.restakers + ? assetFormatter.format( + state.restakerTrend[state.restakerTrend.length - 1] + ?.restakers + ) + : 'N/A'}
diff --git a/src/shared/Sidebar.jsx b/src/shared/Sidebar.jsx index 75b63f2d..04d71f80 100644 --- a/src/shared/Sidebar.jsx +++ b/src/shared/Sidebar.jsx @@ -25,10 +25,11 @@ export default function Sidebar({ onOpenChange }) {