From b204876cfd803fc115029ac6501c67657dcec19e Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Fri, 23 Jul 2021 17:57:49 +0530 Subject: added menu to switch single/multiplayer --- src/components/App.js | 27 ++++++++++++++++++++++++--- src/components/style.css | 30 ++++++++++++++++++------------ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 353e464..f10b5eb 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -24,13 +24,15 @@ import Footer from './Footer'; import './style.css'; const App = () => { + const [gameStarted, setGameStarted] = useState(false); + const [multiplayer, setMultiplayer] = useState(false); const [scoreX, setScoreX] = useState(0); const [scoreO, setScoreO] = useState(0); const [turn, setTurn] = useState(1); const [showMessageBox, setShowMessageBox] = useState(false); const [message, setMessage] = useState(""); - const mp = true; - return ( + + return gameStarted ? ( <> {showMessageBox && { scoreO={scoreO} /> - {mp ? { /> } +