From b136869448339b24dd95560c77222e544d152a3e Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 10 Jul 2025 20:50:06 -0700 Subject: add link to chartview from score views --- frontend/src/components/displays/GenericScoreDisplay.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'frontend/src/components/displays/GenericScoreDisplay.tsx') diff --git a/frontend/src/components/displays/GenericScoreDisplay.tsx b/frontend/src/components/displays/GenericScoreDisplay.tsx index 66bfe2a..255c804 100644 --- a/frontend/src/components/displays/GenericScoreDisplay.tsx +++ b/frontend/src/components/displays/GenericScoreDisplay.tsx @@ -1,4 +1,6 @@ import React from "react"; +import SHA1 from "crypto-js/sha1"; +import { Link } from "react-router"; import { globalSkipKeys } from "../../types/constants"; interface Score { @@ -73,6 +75,8 @@ const ScoreDisplay: React.FC = ({ "grade", ]; const expandableKeys = ["judgements", "optional"]; + // get ?game= + const internalGameName =new URLSearchParams(window.location.search).get("game") || "dancerush"; // eslint-disable-next-line @typescript-eslint/no-explicit-any const formatValue = (value: any, key: string): string => { if (value === null || value === undefined) return "N/A"; @@ -266,6 +270,7 @@ const ScoreDisplay: 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 { primary, mainStats, expandable, others, timestamp } = getScoreEntries(score); @@ -279,7 +284,7 @@ const ScoreDisplay: React.FC = ({
{!hideTitleArtist && ( - <> +

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

@@ -288,7 +293,7 @@ const ScoreDisplay: React.FC = ({ {score.artist}

)} - + )} {showUsername && score.username && (

-- cgit v1.2.3