From db1140ebce2c1a8ac473a01d719c48c245b00119 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 23 Oct 2025 11:50:05 -0700 Subject: refactor: more display refactor, remove invisible mainkey mappings --- .../components/displays/ReflecBeatScoreDisplay.tsx | 35 ++++------------------ 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'frontend/src/components/displays/ReflecBeatScoreDisplay.tsx') diff --git a/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx b/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx index b11983e..9de1403 100644 --- a/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx +++ b/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx @@ -39,49 +39,28 @@ const ReflecBeatScoreDisplay: React.FC = ({ difficulty: "Difficulty", lifeLeft: "Life Remaining", lamp: "Lamp", - diff_lamp: "Lamp", timestamp: "Date", judgements: "Judgements", - maxCombo: "Max Combo", - perfect: "Perfect", + justreflec: "JustReflec", + just: "Just", great: "Great", good: "Good", - bad: "Bad", miss: "Miss", scorePercent: "Score %", - rating: "Rating", - percent: "Percent", - chart: "Chart", - song: "Song", - ranking: "Ranking", - combo: "Combo", - grade: "Grade", level: "Level", - bpm: "BPM", - notes: "Notes", - duration: "Duration", - playcount: "Play Count", date: "Date", time: "Time", username: "Username", - num_players: "Players" }; const mainStatKeys = [ "score", "difficulty", "lamp", - "rank", - "diff_lamp", - "percent", - "rating", - "grade", "scorePercent" ]; 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") || "reflecbeat"; // eslint-disable-next-line @typescript-eslint/no-explicit-any const formatValue = (value: any, key: string): string => { if (value === null || value === undefined) return "N/A"; @@ -278,11 +257,9 @@ const ReflecBeatScoreDisplay: React.FC = ({ return (
{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 ( @@ -294,7 +271,7 @@ const ReflecBeatScoreDisplay: React.FC = ({
{!hideTitleArtist && ( - +

{score.title || score.song || "Unknown Title"}

-- cgit v1.2.3