From 63dba59d25a6f50cc4fde63cae9df384360fb149 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 28 Dec 2020 17:51:09 -0500 Subject: [PATCH] Checker the board --- src/index.css | 1 + src/index.js | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/index.css b/src/index.css index 0e704d7..d407e21 100644 --- a/src/index.css +++ b/src/index.css @@ -42,6 +42,7 @@ ol, ul { margin-top: -1px; padding: 0; text-align: center; + outline: none; } .square:hover { diff --git a/src/index.js b/src/index.js index 08a5fa5..f3bb390 100644 --- a/src/index.js +++ b/src/index.js @@ -72,7 +72,6 @@ function Square(props) { backgroundSize: `100%`, backgroundColor: props.bg, }; - if (props.value != null) { return ( ); - } else { - return ( - - ); - } } class Board extends React.Component { @@ -353,8 +344,10 @@ class Board extends React.Component { } renderSquare(i) { + let plainBg = (i + (Math.floor(i / 8))) % 2 === 0 ? + "white" : "#666"; let bgColor = this.heldPiece() === i ? - "#5D98E6" : "white"; + "#5D98E6" : plainBg; return (