diff --git a/projects/website/src/common/change.tsx b/projects/website/src/common/change.tsx index 888929a..9e12830 100644 --- a/projects/website/src/common/change.tsx +++ b/projects/website/src/common/change.tsx @@ -1,5 +1,6 @@ import React from "react"; import { formatNumberWithCommas, formatPp } from "@ssr/common/utils/number-utils"; +import { clsx } from "clsx"; type ChangeProps = { /** @@ -13,6 +14,11 @@ type ChangeProps = { */ formatValue?: (value: number) => string; + /** + * The additional class names + */ + className?: string; + /** * Whether the number is a pp number */ @@ -24,7 +30,7 @@ type ChangeProps = { showColors?: boolean; }; -export function Change({ change, formatValue, isPp, showColors }: ChangeProps) { +export function Change({ change, formatValue, className, isPp, showColors }: ChangeProps) { if (change === 0 || (change && change > 0 && change < 0.01) || change === undefined) { return null; } @@ -38,7 +44,7 @@ export function Change({ change, formatValue, isPp, showColors }: ChangeProps) { } return ( -
0 ? "text-green-400" : "text-red-400")}`}> +
0 ? "text-green-400" : "text-red-400"), className)}> {change > 0 ? "+" : ""} {`${formatValue(change)}${isPp ? "pp" : ""}`}
diff --git a/projects/website/src/components/score/badges/hand-accuracy.tsx b/projects/website/src/components/score/badges/hand-accuracy.tsx index 3c8e423..74bd2ee 100644 --- a/projects/website/src/components/score/badges/hand-accuracy.tsx +++ b/projects/website/src/components/score/badges/hand-accuracy.tsx @@ -26,7 +26,11 @@ export function HandAccuracyBadge({ score, hand }: HandAccuracyProps) { {scoreImprovement && previousHandAccuracy && (FC
) : ( @@ -67,7 +69,7 @@ export default function ScoreMissesBadge({ score, hideXMark }: ScoreMissesBadgeP wallsHit={misses.wallsHit} fullCombo={additionalData.fullCombo} > -FC
: formatNumberWithCommas(misses.misses)}Performance Points
-Raw: {formatPp(pp)}pp
-- Weighted: {formatPp(weightedPp)}pp ({(100 * weight).toFixed(2)}%) -
- {previousPp && !isSamePp &&Full Combo: {previousPp}pp
} +Performance Points
+Raw: {formatPp(pp)}pp
++ Weighted: {formatPp(weightedPp)}pp ({(100 * weight).toFixed(2)}%) +
+ {fcPp &&Full Combo: {fcPp}pp
} ++ The previous pp may not be 100% accurate due to ScoreSaber API limitations. +
+{formatPp(pp)}pp
- {previousAccuracy &&{formatNumberWithCommas(Number(score.score.toFixed(0)))}
- {scoreImprovement &&