From e6a8ba41fd0c71dc192e5b2513ed41572a3d4c38 Mon Sep 17 00:00:00 2001 From: djmil Date: Mon, 31 Jul 2023 18:35:35 +0200 Subject: [PATCH] show moves history --- src/App.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 0841d47..49dd35a 100644 --- a/src/App.js +++ b/src/App.js @@ -67,13 +67,31 @@ function App() { setXIsNext(!xIsNext); } + function jumpTo(nextMove) { + // TODO + } + + const moves = history.map((squares, move) => { + let description; + if (move > 0) { + description = 'Go to move #' + move; + } else { + description = 'Go to game start'; + } + return ( +
  • + +
  • + ); + }); + return (
    -
      {/*TODO*/}
    +
      {moves}
    );