Bold the currently selected item in the move list

This commit is contained in:
Alice Gaudon 2022-03-13 19:02:20 +01:00
parent ce614c136a
commit 2a7fe34019
2 changed files with 5 additions and 2 deletions

View File

@ -48,3 +48,7 @@ ol, ul {
.game-info {
margin-left: 20px;
}
.selected button {
font-weight: bolder;
}

View File

@ -3,7 +3,6 @@ import ReactDOM from 'react-dom';
import './index.css';
/*TODO
Bold the currently selected item in the move list.
Rewrite Board to use two loops to make the squares instead of hardcoding them.
Add a toggle button that lets you sort the moves in either ascending or descending order.
When someone wins, highlight the three squares that caused the win.
@ -107,7 +106,7 @@ class Game extends React.Component {
'Go to game start' :
`Go to move #${index} [${state.playX}, ${state.playY}]`;
return (
<li key={index}>
<li key={index} className={index === this.state.currentMoveIndex ? 'selected' : null}>
<button onClick={() => this.jumpTo(index)}>{description}</button>
</li>
);