aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/components/displays/NostalgiaScoreDisplay.tsx
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-10-23 11:50:05 -0700
committerPinapelz <yukais@pinapelz.com>2025-10-23 11:50:05 -0700
commitdb1140ebce2c1a8ac473a01d719c48c245b00119 (patch)
treeb3e843cc876120e816654f71a7c128d234717a33 /frontend/src/components/displays/NostalgiaScoreDisplay.tsx
parent59ee072b1501608431174f0cf93592c4bc5668a5 (diff)
refactor: more display refactor, remove invisible mainkey mappings
Diffstat (limited to 'frontend/src/components/displays/NostalgiaScoreDisplay.tsx')
-rw-r--r--frontend/src/components/displays/NostalgiaScoreDisplay.tsx32
1 files changed, 9 insertions, 23 deletions
diff --git a/frontend/src/components/displays/NostalgiaScoreDisplay.tsx b/frontend/src/components/displays/NostalgiaScoreDisplay.tsx
index bb01379..063d449 100644
--- a/frontend/src/components/displays/NostalgiaScoreDisplay.tsx
+++ b/frontend/src/components/displays/NostalgiaScoreDisplay.tsx
@@ -38,31 +38,21 @@ const NostalgiaScoreDisplay: React.FC<ScoreDisplayProps> = ({
score: "Score",
difficulty: "Difficulty",
lamp: "Lamp",
- diff_lamp: "Lamp",
timestamp: "Date",
judgements: "Judgements",
maxCombo: "Max Combo",
perfect: "Perfect",
- great: "Great",
+ fast: "Fast",
+ slow: "Slow",
good: "Good",
- bad: "Bad",
+ just: "Just",
miss: "Miss",
- rating: "Rating",
- percent: "Percent",
- chart: "Chart",
- song: "Song",
- ranking: "Ranking",
- combo: "Combo",
- grade: "Grade",
+ near: "Near",
+ marvelous: "Marvelous",
level: "Level",
- bpm: "BPM",
notes: "Notes",
- duration: "Duration",
- playcount: "Play Count",
date: "Date",
- time: "Time",
username: "Username",
- num_players: "Players"
};
const mainStatKeys = [
@@ -77,9 +67,7 @@ const NostalgiaScoreDisplay: React.FC<ScoreDisplayProps> = ({
"level"
];
const expandableKeys = ["judgements", "optional"];
- const skipKeys = ["user", "username"]
- // get ?game=
- const internalGameName =new URLSearchParams(window.location.search).get("game") || "dancerush";
+ const gameParam = new URLSearchParams(window.location.search).get("game") || "nostalgia";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const formatValue = (value: any, key: string): string => {
if (value === null || value === undefined) return "N/A";
@@ -272,11 +260,9 @@ const NostalgiaScoreDisplay: React.FC<ScoreDisplayProps> = ({
return (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-4 sm:gap-6">
{sortedScores.map((score, index) => {
- const chartIdHash = SHA1(`${internalGameName}${score.title}${score.artist}`).toString();
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const { mainStats, expandable, others: rawOthers, timestamp } =
+ const chartIdHash = SHA1(`${gameParam}${score.title}${score.artist}`).toString();
+ const { mainStats, expandable, others, timestamp } =
getScoreEntries(score);
- const others = rawOthers.filter(([key]) => !skipKeys.includes(key));
return (
@@ -288,7 +274,7 @@ const NostalgiaScoreDisplay: React.FC<ScoreDisplayProps> = ({
<div className="flex items-start justify-between mb-4">
<div className="flex-1 min-w-0">
{!hideTitleArtist && (
- <Link to={`/chart?chartId=${chartIdHash}&game=${internalGameName}`}>
+ <Link to={`/chart?chartId=${chartIdHash}&game=${gameParam}`}>
<h3 className="text-base sm:text-lg font-semibold text-white mb-1 break-words leading-tight">
{score.title || score.song || "Unknown Title"}
</h3>
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage