Skip to content

Commit 3cdafa6

Browse files
committed
feat: Display XP instead of Level in PlatformAnalytics Top Performers
- Updated PlatformAnalytics to show XP alongside points for top performing users - Added experience field to topPerformingUsers type in analytics/types.ts - Updated analyticsService to include experience data in user engagement metrics - Added fallback value (|| 0) to handle accounts without experience field
1 parent 6cbeeb3 commit 3cdafa6

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

analytics/components/PlatformAnalytics.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,13 @@ export const PlatformAnalytics: React.FC<PlatformAnalyticsProps> = ({ className
337337
</div>
338338
<div>
339339
<p className={`${themeClasses.text} font-medium`}>{user.displayName}</p>
340-
<p className={`${themeClasses.textMuted} text-sm`}>Level {user.level}</p>
340+
{/* <p className={`${themeClasses.textMuted} text-sm`}>Level {user.level}</p> */}
341341
</div>
342342
</div>
343343
<div className='text-right'>
344344
<p className={`${themeClasses.text} font-medium`}>
345-
{user.totalPoints.toLocaleString()} pts
345+
{user.totalPoints.toLocaleString()} pts /
346+
{(user.experience || 0).toLocaleString()} XP
346347
</p>
347348
<p className={`${themeClasses.textMuted} text-sm`}>
348349
{user.demosCompleted} demos, {user.badgesEarned} badges

analytics/services/analyticsService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ export class AnalyticsService {
413413
userId: account.walletAddress,
414414
displayName: account.displayName,
415415
level: account.level,
416+
experience: account.experience,
416417
totalPoints: account.totalPoints,
417418
demosCompleted: demosCompleted.length,
418419
badgesEarned: badgesEarned.length,

analytics/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export interface UserEngagementMetrics {
129129
userId: string;
130130
displayName: string;
131131
level: number;
132+
experience: number;
132133
totalPoints: number;
133134
demosCompleted: number;
134135
badgesEarned: number;

app/home/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { AuthModal } from '@/components/ui/auth/AuthModal';
2323
import { UserProfile } from '@/components/ui/navigation/UserProfile';
2424
import { AccountStatusIndicator } from '@/components/ui/AccountStatusIndicator';
2525
import { LeaderboardSidebar } from '@/components/ui/LeaderboardSidebar';
26-
import { PreloaderScreen } from '@/components/ui/PreloaderScreen';
2726
import { VideoPreloaderScreen } from '@/components/ui/VideoPreloaderScreen';
2827
import { StartButtonScreen } from '@/components/home/StartButtonScreen';
2928
import { QuestAndReferralSection } from '@/components/ui/quest/QuestAndReferralSection';

0 commit comments

Comments
 (0)