X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=scribe%2Fscribe.jsx;h=ae05690dd42febe119b2541ab37b8e7ee6bf33f9;hp=2cc51483c3a429f5a2f0d0e91d7ddf0deda8109c;hb=ece82f79122ffd6f1e3c8fb0d0dac7daae824b92;hpb=c6ffca52b75480ad51ff1907a990b02f64885476 diff --git a/scribe/scribe.jsx b/scribe/scribe.jsx index 2cc5148..ae05690 100644 --- a/scribe/scribe.jsx +++ b/scribe/scribe.jsx @@ -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 ( props.onClick(j)} /> @@ -402,9 +407,9 @@ class Board extends React.Component { * b. This mini grid corresponds to this players last turn * c. The mini grid that corresponds to the players last turn is full */ - let active = false; + let grid_active = false; if (this.props.active) { - active = true; + grid_active = true; if (this.props.last_two_moves.length > 1) { /* First index (0) gives us our last move, (that is, of the * last two moves, it's the first one, so two moves ago). @@ -422,7 +427,7 @@ class Board extends React.Component { /* If the target mini-grid isn't full then this grid is * only active if it is that target. */ if (occupied < 9) - active = (i === target); + grid_active = (i === target); } } @@ -438,7 +443,7 @@ class Board extends React.Component { return ( this.props.onClick(i,j)} />