Skip to content

Commit

Permalink
fix: fix tooltip issue on switch tab in home chart
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaaru authored and RanGojo committed Nov 11, 2024
1 parent e93a35f commit 91f1a1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/home/ChartBox/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ const Chart = (props: ChartProps) => {
</span>
{currentPeriod && prevPeriod ? (
<div>
{currentPeriod && (
{currentPeriod.length > 0 && (
<div className="flex items-center mr-20">
<span
className={`w-[0.25rem] md:w-[0.375rem] h-[0.25rem] md:h-[0.375rem] mr-5 rounded-full bg-secondary-500`}></span>
Current:
<span className="text-baseForeground pl-1">
{AmountConverter(
tooltipData.datumByKey[currentPeriodKey].datum
tooltipData.datumByKey[currentPeriodKey]?.datum
.count,
)}
</span>
Expand All @@ -181,7 +181,7 @@ const Chart = (props: ChartProps) => {
Previous:
<span className="text-baseForeground pl-1">
{AmountConverter(
tooltipData.datumByKey[prevPeriodKey].datum.count,
tooltipData.datumByKey[prevPeriodKey]?.datum.count,
)}
</span>
</div>
Expand Down

0 comments on commit 91f1a1d

Please sign in to comment.