Skip to content
Permalink
Browse files

Bold the currently selected item in the move list - improved

  • Loading branch information...
Sercan Leylek
Sercan Leylek committed Feb 23, 2019
1 parent c13c7fe commit 83dcaa90fa9196d52e9665b4dd95da6a04cd723d
Showing with 9 additions and 13 deletions.
  1. +9 −13 tic-tac-toe/src/components/Game/Game.js
@@ -63,20 +63,16 @@ class Game extends React.Component {
const desc = move ?
'Go to move #' + move + " at " + step.row + "," + step.col:
'Go to game start';
if (this.state.stepNumber === move) {
return (
<li key={move}>
<button onClick={() => this.jumpTo(move)} className="selectedMove">{desc}</button>
</li>
);
}
else {
return (
<li key={move}>
<button onClick={() => this.jumpTo(move)}>{desc}</button>
</li>
);

let selectedMove = "";
if (this.state.stepNumber === move && history.length > move + 1) {
selectedMove = "selectedMove";
}
return (
<li key={move}>
<button onClick={() => this.jumpTo(move)} className={selectedMove}>{desc}</button>
</li>
);
});

let status;

0 comments on commit 83dcaa9

Please sign in to comment.
You can’t perform that action at this time.