Skip to content

Commit

Permalink
add color to game report (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro authored Oct 9, 2023
1 parent 1b21f0b commit c3b1858
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/components/panels/analysis/AnalysisPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<React.Fragment key={annotation}>
<Grid.Col span={4} sx={{ textAlign: "center" }}>
{whiteAnnotations[s]}
<Grid.Col
span={4}
sx={{ textAlign: "center" }}
c={w > 0 ? color : undefined}
>
{w}
</Grid.Col>
<Grid.Col span={1} c={w + b > 0 ? color : undefined}>
{annotation}
</Grid.Col>
<Grid.Col span={4} c={w + b > 0 ? color : undefined}>
{name}
</Grid.Col>
<Grid.Col span={2} c={b > 0 ? color : undefined}>
{b}
</Grid.Col>
<Grid.Col span={1}>{annotation}</Grid.Col>
<Grid.Col span={4}>{ANNOTATION_INFO[s].name}</Grid.Col>
<Grid.Col span={2}>{blackAnnotations[s]}</Grid.Col>
</React.Fragment>
);
})}
Expand Down

0 comments on commit c3b1858

Please sign in to comment.