From 413d72182d5e9459ea2969369a5570c2c977e6a3 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 26 Oct 2024 11:38:16 +0100 Subject: [PATCH] add per hand real accuracy (eg: 95%) --- .../components/score/badges/hand-accuracy.tsx | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/projects/website/src/components/score/badges/hand-accuracy.tsx b/projects/website/src/components/score/badges/hand-accuracy.tsx index 74bd2ee..970699b 100644 --- a/projects/website/src/components/score/badges/hand-accuracy.tsx +++ b/projects/website/src/components/score/badges/hand-accuracy.tsx @@ -16,16 +16,33 @@ export function HandAccuracyBadge({ score, hand }: HandAccuracyProps) { } const { handAccuracy } = score.additionalData; const scoreImprovement = score.additionalData.scoreImprovement; + const currentHandAccuracy = handAccuracy[hand]; const previousHandAccuracy = scoreImprovement ? handAccuracy[hand] - scoreImprovement.handAccuracy[hand] : undefined; const formattedHand = capitalizeFirstLetter(hand); return (
- -

{handAccuracy[hand].toFixed(2)}

+ +

{formattedHand} Hand Accuracy

+

Hand Accuracy: {currentHandAccuracy.toFixed(2)}

+

Accuracy: {((currentHandAccuracy / 115) * 100).toFixed(2)}%

+ + } + > +

{currentHandAccuracy.toFixed(2)}

{scoreImprovement && previousHandAccuracy && ( - + +

{formattedHand} Hand Accuracy

+

Hand Accuracy: {previousHandAccuracy.toFixed(2)}

+

Accuracy: {((previousHandAccuracy / 115) * 100).toFixed(2)}%

+ + } + >