diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 904e13d..f380174 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,15 +13,15 @@ TITLE: Include your section in the pull request title - [ ] Wednesday 6pm IP - [ ] Wednesday 6:30pm Virtual -- [ ] Friday 6:30pm +- [x] Friday 6:30pm **Is the solution complete?** -[Yes/No] +[Yes] **Did you run into any problems?** -[Describe...] +[No] **Did you collaborate with others on this solution?** diff --git a/src/components/BoardSwitcher.jsx b/src/components/BoardSwitcher.jsx index e99793a..504474d 100644 --- a/src/components/BoardSwitcher.jsx +++ b/src/components/BoardSwitcher.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; function Board(props) { let className = "board"; @@ -10,16 +10,22 @@ function Board(props) { } function BoardSwitcher(props) { + const [selectedBoardIndex, setSelectedBoardIndex] = useState(0); + + const handleClick = (event) => { + setSelectedBoardIndex((selectedBoardIndex + 1) % props.numBoards); + } + let boards = []; - for (let ii = 0; ii < props.numBoards; ii++) { - let isSelected = ii === 0; - boards.push(); + for (let i = 0; i < props.numBoards; i++) { + let isBoardSelected = i === selectedBoardIndex; + boards.push(); } return (
{boards}
- +
); } diff --git a/src/main.jsx b/src/main.jsx index 782f402..316ad56 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -6,6 +6,6 @@ import "./index.css"; const root = ReactDOM.createRoot(document.getElementById("root")); root.render( - + );