Skip to content

Commit

Permalink
stats: display previous 24h vol
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Sep 30, 2024
1 parent 8fc4f1a commit 24c6f90
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions app/stats/charts/volume-chart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import * as React from "react"

import numeral from "numeral"
Expand Down Expand Up @@ -57,23 +55,15 @@ 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 (
<Card className="w-full rounded-none">
<CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
<div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
<CardTitle className="font-serif text-4xl font-bold tracking-tighter lg:tracking-normal">
{cumulativeVolumeLabel ? (
{cumulativeVolume ? (
cumulativeVolumeLabel
) : (
<Skeleton className="h-10 w-40" />
Expand Down

0 comments on commit 24c6f90

Please sign in to comment.