]> git.cworth.org Git - lmno.games/blobdiff - scribe/scribe.jsx
Fix square to not be active if occupied
[lmno.games] / scribe / scribe.jsx
index d66fc049b9a90b7c17c94ad39942b6d03312f17a..ae05690dd42febe119b2541ab37b8e7ee6bf33f9 100644 (file)
@@ -353,10 +353,15 @@ function MiniGrid(props) {
   function grid_square(j) {
     const value = props.squares[j];
     const last_move = props.last_moves.includes(j);
+
+    /* Even if the grid is active, the square is only active if
+     * unoccupied. */
+    const square_active = (props.active && (value === null));
+
     return (
       <Square
         value={value}
-        active={props.active}
+        active={square_active}
         last_move={last_move}
         onClick={() => props.onClick(j)}
       />