From 28d4d951bff3312a628b82c5b7372c6d5662d17d Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 26 Oct 2023 17:44:10 +0100 Subject: [PATCH] show stars if ranked --- src/components/player/Score.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/player/Score.tsx b/src/components/player/Score.tsx index 43b4553..c3fa9df 100644 --- a/src/components/player/Score.tsx +++ b/src/components/player/Score.tsx @@ -10,6 +10,7 @@ import { formatDate, formatTimeAgo } from "@/utils/timeUtils"; import { CheckIcon, GlobeAsiaAustraliaIcon, + StarIcon, XMarkIcon, } from "@heroicons/react/20/solid"; import clsx from "clsx"; @@ -27,6 +28,11 @@ export default function Score({ score, player, leaderboard }: ScoreProps) { const diffName = scoresaberDifficultyNumberToName( leaderboard.difficulty.difficulty, ); + const diffNameShort = scoresaberDifficultyNumberToName( + leaderboard.difficulty.difficulty, + true, + ); + const diffColor = songDifficultyToColor(diffName); return (
@@ -54,15 +60,19 @@ export default function Score({ score, player, leaderboard }: ScoreProps) { loading="lazy" />

- {scoresaberDifficultyNumberToName( - leaderboard.difficulty.difficulty, - true, + {leaderboard.ranked ? ( +

+ + {leaderboard.stars.toFixed(2)} +
+ ) : ( + diffNameShort )}