Commit 8157687b authored by 佚名's avatar 佚名 🎅🏼

feat: bg color

parent 2cd2423d
......@@ -5,6 +5,7 @@ import { Button } from './style';
const Square = (props) => {
return (
<Button
className={props.value==='X' ? 'blue' : props.value==='O' ? 'red' : ''}
onClick={props.onClick}
>
{props.value}
......
......@@ -16,6 +16,12 @@ export const Button = styled.button`
&:focus {
outline: none
}
&.blue {
background: blue;
}
&.red {
background: red;
}
`
export const BoardRow = styled.div`
......
......@@ -38,7 +38,6 @@ export default {
const history = state.history.slice(0, state.stepNumber + 1);
const current = history[history.length - 1];
const squares = current.squares.slice();
console.log(action.payload)
if (calculateWinner(squares) || squares[action.payload]) {
return {...state};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment