From 51ecd6774703f3c982551dbcbb007b7d02c50453 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 21 Oct 2023 02:38:18 +0100 Subject: [PATCH] update score stat labels again --- src/components/Score.tsx | 57 +++++++++++++++++++------------ src/components/ScoreStatLabel.tsx | 15 ++++---- 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/src/components/Score.tsx b/src/components/Score.tsx index 114c4b0..b3804b7 100644 --- a/src/components/Score.tsx +++ b/src/components/Score.tsx @@ -2,6 +2,7 @@ import { ScoresaberLeaderboardInfo } from "@/schemas/scoresaber/leaderboard"; import { ScoresaberScore } from "@/schemas/scoresaber/score"; import { formatNumber } from "@/utils/number"; import { GlobeAsiaAustraliaIcon } from "@heroicons/react/20/solid"; +import clsx from "clsx"; import moment from "moment"; import Image from "next/image"; import ScoreStatLabel from "./ScoreStatLabel"; @@ -12,6 +13,8 @@ type ScoreProps = { }; export default function Score({ score, leaderboard }: ScoreProps) { + const isFullCombo = score.missedNotes + score.badCuts === 0; + return (
@@ -59,30 +62,42 @@ export default function Score({ score, leaderboard }: ScoreProps) {
{/* PP */} -
- {score.pp > 0 && ( +
+
+ {score.pp > 0 && ( + + )} + + {/* Percentage score */} - )} +
- {/* Percentage score */} - - - {/* Missed Notes */} - +
+ {/* Missed Notes */} + +
diff --git a/src/components/ScoreStatLabel.tsx b/src/components/ScoreStatLabel.tsx index 55962bf..988e757 100644 --- a/src/components/ScoreStatLabel.tsx +++ b/src/components/ScoreStatLabel.tsx @@ -3,24 +3,25 @@ import clsx from "clsx"; type LabelProps = { value: string; title?: string; + icon?: JSX.Element; className?: string; }; export default function ScoreStatLabel({ value, title, + icon, className = "bg-neutral-700", }: LabelProps) { return ( -
+
-

+

{value} + {icon}