From e6df48063fc9731838bdd9e40ebcfa9bb18cf7fe Mon Sep 17 00:00:00 2001 From: GuillaumeSD Date: Fri, 8 Mar 2024 00:28:47 +0100 Subject: [PATCH] feat : add move indicator on self game --- src/sections/analysis/board/squareRenderer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sections/analysis/board/squareRenderer.tsx b/src/sections/analysis/board/squareRenderer.tsx index 5418b60..50229b0 100644 --- a/src/sections/analysis/board/squareRenderer.tsx +++ b/src/sections/analysis/board/squareRenderer.tsx @@ -15,15 +15,15 @@ const SquareRenderer = forwardRef( const toSquare = position.lastMove?.to; const moveClassification = position?.eval?.moveClassification; - const showPlayerMove = moveClassification && showPlayerMoveIcon; - const customSquareStyle: CSSProperties | undefined = - showPlayerMove && (fromSquare === square || toSquare === square) + fromSquare === square || toSquare === square ? { position: "absolute", width: "100%", height: "100%", - backgroundColor: moveClassificationColors[moveClassification], + backgroundColor: moveClassification + ? moveClassificationColors[moveClassification] + : "#ffff33", opacity: 0.5, } : undefined; @@ -32,7 +32,7 @@ const SquareRenderer = forwardRef(
{children} {customSquareStyle &&
} - {showPlayerMove && square === toSquare && ( + {moveClassification && showPlayerMoveIcon && square === toSquare && (