From 44606b2c510bb327982f60506fc0c968a51b6e80 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 5 Nov 2025 15:13:47 -0800 Subject: add score uploaded by game stats to profile page --- frontend/src/pages/Profile.tsx | 46 +++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) (limited to 'frontend') diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx index bffc710..83aa701 100644 --- a/frontend/src/pages/Profile.tsx +++ b/frontend/src/pages/Profile.tsx @@ -9,7 +9,13 @@ import Heatmap from "../components/Heatmap"; import type { HeatmapData } from "../components/Heatmap"; import type { User } from "../utils/authApi"; -interface recentPlayedGame { +interface ScoreCountByGame { + gameInternalName: string; + formattedName: string; + count: number; +} + +interface RecentPlayedGame { gameInternalName: string; formattedName: string; timestamp: number; @@ -17,7 +23,8 @@ interface recentPlayedGame { interface UserData { user: User; - recentPlayedGames: recentPlayedGame[]; + recentPlayedGames: RecentPlayedGame[]; + scoreCountByGame: ScoreCountByGame[]; isAdmin: boolean; } @@ -132,9 +139,14 @@ const Profile = () => { {user.username}

- {userData?.user.bio ? userData.user.bio.replace(//g, '>') : "I'm a fairly non-descript person"} + {userData?.user?.bio ? userData.user.bio.replace(//g, '>') : "I'm a fairly non-descript person"}

+ {isBrowser ? ( +
+ +
+ ) : null}

Recently Played Games

- {isBrowser ? ( -
- -
- ) : null} - +
+

Total Scores

+ + + + + + + + + {userData?.scoreCountByGame + .sort((a, b) => b.count - a.count) + .map((score, index) => ( + + + + + ))} + +
GameTotal Scores Uploaded
{score.formattedName}{score.count}
+
+ ); }; -- cgit v1.2.3