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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user