From 0db1896ec9dee6593197a672b819ebb90dbea05e Mon Sep 17 00:00:00 2001 From: Hardik Sankhla Date: Fri, 26 Sep 2025 05:02:30 +0530 Subject: [PATCH] fix: Correct progress bar logic to show exclusivity percentage - Display percentage remaining (99% when 5 registered) - Progress bar width matches display percentage - Use Math.floor for more precise percentage display - Bar shows decreasing exclusivity as registrations increase - Maintains visual consistency between text and bar --- src/components/LiveCounter.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/LiveCounter.tsx b/src/components/LiveCounter.tsx index 8576bb2..a585994 100644 --- a/src/components/LiveCounter.tsx +++ b/src/components/LiveCounter.tsx @@ -17,7 +17,9 @@ const LiveCounter: React.FC = ({ onJoinWaitlist, onOpenLogin } }, [remainingSpots, totalSpots]); const isLive = remainingSpots > 0; - const percentageLeft = (remainingSpots / totalSpots) * 100; + const takenSpots = totalSpots - remainingSpots; + const percentageTaken = (takenSpots / totalSpots) * 100; + const displayPercentage = 100 - percentageTaken; return (
@@ -59,13 +61,13 @@ const LiveCounter: React.FC = ({ onJoinWaitlist, onOpenLogin }
Progress - {Math.round(percentageLeft)}% + {Math.floor(displayPercentage)}%