From c3b18583d5e36b29f9142a048c71094a4c3fe167 Mon Sep 17 00:00:00 2001 From: Francisco Salgueiro <92053465+franciscoBSalgueiro@users.noreply.github.com> Date: Mon, 9 Oct 2023 23:18:48 +0100 Subject: [PATCH] add color to game report (#38) --- .../panels/analysis/AnalysisPanel.tsx | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/panels/analysis/AnalysisPanel.tsx b/src/components/panels/analysis/AnalysisPanel.tsx index a8d9b90e..12397210 100644 --- a/src/components/panels/analysis/AnalysisPanel.tsx +++ b/src/components/panels/analysis/AnalysisPanel.tsx @@ -137,14 +137,27 @@ const GameStats = memo( .filter((a) => a !== "") .map((annotation) => { const s = annotation as "??" | "?" | "?!" | "!!" | "!" | "!?"; + const { name, color } = ANNOTATION_INFO[s]; + const w = whiteAnnotations[s]; + const b = blackAnnotations[s]; return ( - - {whiteAnnotations[s]} + 0 ? color : undefined} + > + {w} + + 0 ? color : undefined}> + {annotation} + + 0 ? color : undefined}> + {name} + + 0 ? color : undefined}> + {b} - {annotation} - {ANNOTATION_INFO[s].name} - {blackAnnotations[s]} ); })}