diff --git a/src/components/AccountStreak/AccountStreak.tsx b/src/components/AccountStreak/AccountStreak.tsx index b269011f5..938bcda3d 100644 --- a/src/components/AccountStreak/AccountStreak.tsx +++ b/src/components/AccountStreak/AccountStreak.tsx @@ -2,9 +2,9 @@ import { useEffect, useRef, useState } from 'react'; import { isLoggedIn } from '../../lib/jwt'; import { httpGet } from '../../lib/http'; import { useToast } from '../../hooks/use-toast'; -import { ChevronDown, Flame, X } from 'lucide-react'; +import { Flame, X } from 'lucide-react'; import { useOutsideClick } from '../../hooks/use-outside-click'; -import { cn } from '../../lib/classname'; +import { StreakDay } from './StreakDay'; type StreakResponse = { count: number; @@ -69,7 +69,9 @@ export function AccountStreak(props: AccountStreakProps) { const currentCircleCount = Math.min(currentCount, 5) + 1; // Adding one day to show the streak they broke const leftCircleCount = Math.min(5 - currentCircleCount, previousCount) + 1; + // In the maximum case, we will show 10 circles const remainingCount = Math.max(0, 10 - leftCircleCount - currentCircleCount); + const totalCircles = leftCircleCount + currentCircleCount + remainingCount; return (
+
Current Streak - + {accountStreak?.count || 0}
-+
Longest Streak - + {accountStreak?.longestCount || 0}