{
[0, 1, 2, 3, 4, 5, 6, 7]
.map(n => this.renderSquare(n + i))
}
);
}
render() {
let checkMsg = this.whoInCheck() ? "Check! " : "";
let isCheckmate = this.checkmate();
let namedPlayer = isCheckmate ?
!this.state.blackIsNext : this.state.blackIsNext
let color = namedPlayer ? 'Black' : 'White';
const status = isCheckmate ? "Checkmate! " + color + " Wins!" :
checkMsg + color + "'s Turn";
let texttext =
{status}
{[0, 1, 2, 3, 4, 5, 6, 7]
.map(n => this.row(n))}
;
return (
texttext
);
}
}
class Game extends React.Component {
render() {
return (