diff --git a/src/pages/Chessboard.container.tsx b/src/pages/Chessboard.container.tsx index 061441a..049053c 100644 --- a/src/pages/Chessboard.container.tsx +++ b/src/pages/Chessboard.container.tsx @@ -4,8 +4,6 @@ import Chessboard from "#/pages/Chessboard.tsx"; const ChessboardContainer = () => { const chessGameProps = useChessGame(); - console.log(chessGameProps.currentPosition); - return ( { handleToggleDiagram={chessGameProps.handleToggleDiagram} handlePlyChange={chessGameProps.handlePlyChange} fileInputRef={chessGameProps.fileInputRef} + currentPosition={chessGameProps.currentPosition} /> ); }; diff --git a/src/pages/Chessboard.tsx b/src/pages/Chessboard.tsx index 5a821d8..4b9dd43 100644 --- a/src/pages/Chessboard.tsx +++ b/src/pages/Chessboard.tsx @@ -14,6 +14,7 @@ interface IProps { handleToggleDiagram: () => void; handlePlyChange: ({ ply, fen }: { ply: number; fen: string }) => void; fileInputRef: RefObject; + currentPosition: { ply: number; fen: string }; } const Chessboard = ({ @@ -26,6 +27,7 @@ const Chessboard = ({ handleToggleDiagram, handlePlyChange, fileInputRef, + currentPosition, }: IProps) => { return (
@@ -84,6 +86,9 @@ const Chessboard = ({ name="diagram-toggle" type="checkbox" className="checkbox-accent" + checked={gameState.diagrams.some( + (d) => d.ply === currentPosition.ply, + )} onChange={handleToggleDiagram} />