fix(leaderboard): fix counter animation and number formatting

- AnimatedNumber: add ScrollTrigger so counters animate on scroll-into-view
  instead of firing immediately on mount (fixes table rows animating before
  the user scrolls to them)
- AnimatedNumber: lock locale to 'en-US' for consistent comma formatting
- LeaderboardPage: lock formatValue locale to 'en-US'
- mockStore: update MOCK_SALES_HISTORY dates from Jan/Feb to March 2026 so
  the default "This Month" filter returns data; previous dates caused all
  agents to show $0 revenue, making the animation appear broken
- mockStore: replace unrealistic amounts ($250K–$520K) with realistic
  residential roofing job values ($12K–$42K per deal)
This commit is contained in:
Satyam
2026-03-20 17:56:41 +05:30
parent 546c202b9f
commit cd3b6c8cfe
3 changed files with 50 additions and 51 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ const LeaderboardPage = () => {
}, [agents, salesHistory, timeframe, metric]);
const formatValue = (val, type) => {
if (type === 'revenue') return `$${val.toLocaleString()}`;
if (type === 'revenue') return `$${val.toLocaleString('en-US')}`;
if (type === 'volume') return `${val} Deals`;
if (type === 'winRate') return `${val.toFixed(1)}%`;
return val;