diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-09-26 00:51:22 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-09-26 00:51:22 -0700 |
| commit | 95d1fdd32712721ce065780d4be44ea8f6b6db59 (patch) | |
| tree | e8a2a368874f0d5941878debea49369183d61151 /frontend/src/pages | |
| parent | 9f7d4329c7e0074f05289113e84879e0fd009d54 (diff) | |
implement dancearound custom score view
Diffstat (limited to 'frontend/src/pages')
| -rw-r--r-- | frontend/src/pages/Chart.tsx | 16 | ||||
| -rw-r--r-- | frontend/src/pages/Score.tsx | 12 |
2 files changed, 27 insertions, 1 deletions
diff --git a/frontend/src/pages/Chart.tsx b/frontend/src/pages/Chart.tsx index 19f57cc..757cbbb 100644 --- a/frontend/src/pages/Chart.tsx +++ b/frontend/src/pages/Chart.tsx @@ -10,6 +10,7 @@ type SortField = string; type SortDirection = "asc" | "desc"; import { getFilterOptions } from "../types/constants"; +import DancearoundScoreDisplay from "../components/displays/DancearoundScoreDisplay"; const Chart = () => { const { user, isLoading, logout } = useAuth(); @@ -82,6 +83,7 @@ const Chart = () => { url.searchParams.append("sortKey", requestOrder); url.searchParams.append("direction", "asc"); url.searchParams.append("pbOnly", "true"); + url.searchParams.append("game", gameName); const response = await fetch(url.toString(), {credentials: 'include'}); if (!response.ok) throw new Error("Failed to fetch scores"); @@ -97,7 +99,7 @@ const Chart = () => { setLoading(false); } }, - [user, requestOrder, chartIdHash], + [user, requestOrder, chartIdHash, gameName], ); useEffect(() => { @@ -184,6 +186,18 @@ const Chart = () => { hideTitleArtist={true} /> ); + case "dancearound": + return ( + <DancearoundScoreDisplay + scores={scores} + viewMode={viewMode} + sortField={sortField} + sortDirection={sortDirection} + onSort={handleSort} + showUsername={true} + hideTitleArtist={true} + /> + ); default: return ( <ScoreDisplay diff --git a/frontend/src/pages/Score.tsx b/frontend/src/pages/Score.tsx index 3474f1b..5214f5b 100644 --- a/frontend/src/pages/Score.tsx +++ b/frontend/src/pages/Score.tsx @@ -5,6 +5,7 @@ import { NavBar } from "../components/NavBar"; import SessionExpiredPopup from "../components/SessionExpiredPopup"; import ScoreDisplay from "../components/displays/GenericScoreDisplay"; import DancerushScoreDisplay from "../components/displays/DancerushScoreDisplay"; +import DancearoundScoreDisplay from "../components/displays/DancearoundScoreDisplay"; type SortField = string; type SortDirection = "asc" | "desc"; @@ -204,6 +205,17 @@ const Score = () => { onDelete={handleDeleteScore} /> ); + case "dancearound": + return ( + <DancearoundScoreDisplay + scores={scores} + viewMode={viewMode} + sortField={sortField} + sortDirection={sortDirection} + onSort={handleSort} + onDelete={handleDeleteScore} + /> + ); default: return ( <ScoreDisplay |
