diff --git a/src/BoardSwitcher.js b/src/BoardSwitcher.js index 61ad96f..679f706 100644 --- a/src/BoardSwitcher.js +++ b/src/BoardSwitcher.js @@ -15,19 +15,30 @@ class Board extends React.Component { } class BoardSwitcher extends React.Component { + constructor(props) { + super(props); + this.state = { + counter: 0, + } + } + + handleBoardClicker = () => { + this.setState({counter: (this.state.counter + 1) % this.props.numBoards}) + } + render() { let boards = []; for (let ii = 0; ii < this.props.numBoards; ii++) { - let isSelected = ii === 0; + let isSelected = ii === this.state.counter; boards.push( - + ); } return (
{boards}
- +
); }