Skip to content
Permalink
Browse files

Bold the currently selected item in the move list

  • Loading branch information...
Sercan Leylek
Sercan Leylek committed Feb 21, 2019
1 parent 052f7da commit c13c7fea5d7f7bc9ce694bc953d5f67ea6aa878f
Showing with 18 additions and 5 deletions.
  1. +14 −5 tic-tac-toe/src/components/Game/Game.js
  2. +4 −0 tic-tac-toe/src/index.css
@@ -63,11 +63,20 @@ class Game extends React.Component {
const desc = move ?
'Go to move #' + move + " at " + step.row + "," + step.col:
'Go to game start';
return (
<li key={move}>
<button onClick={() => this.jumpTo(move)}>{desc}</button>
</li>
);
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 status;
@@ -47,4 +47,8 @@ ol, ul {

.game-info {
margin-left: 20px;
}

.selectedMove {
font-weight: bold;
}

0 comments on commit c13c7fe

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