Game component

This commit is contained in:
djmil 2023-07-31 18:05:26 +02:00
parent e17c55a29d
commit 455f2b1c64
2 changed files with 23 additions and 1 deletions

View File

@ -31,4 +31,13 @@ body {
.status {
margin-bottom: 10px;
}
.game {
display: flex;
flex-direction: row;
}
.game-info {
margin-left: 20px;
}

View File

@ -13,7 +13,7 @@ function Square({value, onSquareClick}) {
);
}
function App() {
function Board() {
const [xIsNext, setXIsNext] = useState(true);
const [squares, setSquares] = useState(Array(9).fill(null));
@ -61,6 +61,19 @@ function App() {
);
}
function App() {
return (
<div className="game">
<div className="game-board">
<Board />
</div>
<div className="game-info">
<ol>{/*TODO*/}</ol>
</div>
</div>
);
}
export default App;
function calculateWinner(squares) {