Skip to content
Snippets Groups Projects
Commit 64129136 authored by Lukas's avatar Lukas Committed by mcfarhat
Browse files

Add add date with year included to a tooltip

parent 108f5f45
No related branches found
No related tags found
1 merge request!599Lbudginas/#493 hive price chart
......@@ -24,10 +24,10 @@ const CustomTooltip = ({
if (active && payload && payload.length) {
return (
<div className="bg-buttonHover text-text p-2 rounded-xl">
{payload.map(({ payload: { date, avgPrice, volume } }) => {
{payload.map(({ payload: { tooltipDate, avgPrice, volume } }) => {
return (
<div key={date}>
<p>{`Date: ${date}`}</p>
<div key={tooltipDate}>
<p>{`Date: ${tooltipDate}`}</p>
<p>{`Average Price: $${avgPrice}`}</p>
<p>{`Volume: ${volume.toLocaleString("en-US")} HIVE`}</p>
</div>
......@@ -85,6 +85,7 @@ const MarketHistoryChart: React.FC<MarketChartProps> = ({
return {
date: moment(bucket.open).format("MMM D"),
tooltipDate: moment(bucket.open).format("YYYY MMM D"),
avgPrice: hiveAveragePrice,
volume: bucket.hive.volume,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment