diff options
Diffstat (limited to 'src/components/App.js')
-rw-r--r-- | src/components/App.js | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/src/components/App.js b/src/components/App.js index 5b13230..3217782 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -35,56 +35,54 @@ const App = () => { const [isHost, setIsHost] = useState(false); const [joinCode, setJoinCode] = useState(); - return gameStarted ? ( + return ( <> - {showMessageBox && - <MessageBox - message={message} - setShowMessage={setShowMessageBox} - /> - } + {gameStarted ? + <> + {showMessageBox && + <MessageBox + message={message} + setShowMessage={setShowMessageBox} + /> + } - <ScoreBoard - turn={turn} - scoreX={scoreX} - scoreO={scoreO} - multiplayer={multiplayer} - isHost={isHost} - /> + <ScoreBoard + turn={turn} + scoreX={scoreX} + scoreO={scoreO} + multiplayer={multiplayer} + isHost={isHost} + /> - {multiplayer ? <MultiplayerGrid - turn={turn} - isHost={isHost} - setTurn={setTurn} - scoreX={scoreX} - setScoreX={setScoreX} - scoreO={scoreO} - setScoreO={setScoreO} - setMessage={setMessage} - setShowMessage={setShowMessageBox} - joinCode={joinCode} - /> : <Grid - turn={turn} - setTurn={setTurn} - scoreX={scoreX} - setScoreX={setScoreX} - scoreO={scoreO} - setScoreO={setScoreO} - setMessage={setMessage} - setShowMessage={setShowMessageBox} + {multiplayer ? <MultiplayerGrid + turn={turn} + isHost={isHost} + setTurn={setTurn} + scoreX={scoreX} + setScoreX={setScoreX} + scoreO={scoreO} + setScoreO={setScoreO} + setMessage={setMessage} + setShowMessage={setShowMessageBox} + joinCode={joinCode} + /> : <Grid + turn={turn} + setTurn={setTurn} + scoreX={scoreX} + setScoreX={setScoreX} + scoreO={scoreO} + setScoreO={setScoreO} + setMessage={setMessage} + setShowMessage={setShowMessageBox} + /> + } + </> : <GamemodeChooser + setMultiplayer={setMultiplayer} + setGameStarted={setGameStarted} + setIsHost={setIsHost} + setJoinCode={setJoinCode} /> } - - <Footer/> - </> - ) : ( - <> - <GamemodeChooser - setMultiplayer={setMultiplayer} - setGameStarted={setGameStarted} - setIsHost={setIsHost} - setJoinCode={setJoinCode} - /> <Footer/> </> ); |