From 24c6f90c749a065d4af14a1817e1769fdff37f5e Mon Sep 17 00:00:00 2001 From: sehyunc <41171808+sehyunc@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:19:19 -0700 Subject: [PATCH] stats: display previous 24h vol --- app/stats/charts/volume-chart.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/app/stats/charts/volume-chart.tsx b/app/stats/charts/volume-chart.tsx index 7a34a24c..763fbcac 100644 --- a/app/stats/charts/volume-chart.tsx +++ b/app/stats/charts/volume-chart.tsx @@ -1,5 +1,3 @@ -"use client" - import * as React from "react" import numeral from "numeral" @@ -57,15 +55,7 @@ export function VolumeChart() { volume: dataPoint.volume, })) - // const { data: cumulativeData } = useCumulativeVolume({ - // from: now - 2 * timePeriod.day, - // to: now, - // }) - // const cumulativeVolumeLabel = React.useMemo(() => { - // if (!cumulativeData) return "" - // return formatStat(cumulativeData[cumulativeData.length - 1].volume) - // }, [cumulativeData]) - const cumulativeVolume = chartData?.[chartData.length - 1]?.volume + const cumulativeVolume = chartData?.[chartData.length - 2]?.volume const cumulativeVolumeLabel = formatStat(cumulativeVolume ?? 0) return ( @@ -73,7 +63,7 @@ export function VolumeChart() {
- {cumulativeVolumeLabel ? ( + {cumulativeVolume ? ( cumulativeVolumeLabel ) : (