Add presenter role for game flow control
This commit is contained in:
parent
99977bc8e6
commit
9ef8f7343d
10 changed files with 1412 additions and 17 deletions
11
App.tsx
11
App.tsx
|
|
@ -91,7 +91,10 @@ function App() {
|
|||
attemptReconnect,
|
||||
goHomeFromDisconnected,
|
||||
endGame,
|
||||
resumeGame
|
||||
resumeGame,
|
||||
presenterId,
|
||||
setPresenterPlayer,
|
||||
sendAdvance
|
||||
} = useGame();
|
||||
|
||||
const handleSaveQuiz = async () => {
|
||||
|
|
@ -199,6 +202,8 @@ function App() {
|
|||
onEndGame={role === 'HOST' ? endGame : undefined}
|
||||
currentPlayerId={currentPlayerId}
|
||||
hostParticipates={gameConfig.hostParticipates}
|
||||
presenterId={presenterId}
|
||||
onSetPresenter={setPresenterPlayer}
|
||||
/>
|
||||
{auth.isAuthenticated && pendingQuizToSave && (
|
||||
<SaveQuizPrompt
|
||||
|
|
@ -259,6 +264,8 @@ function App() {
|
|||
selectedOption={selectedOption}
|
||||
role={role}
|
||||
onNext={showScoreboard}
|
||||
isPresenter={currentPlayerId === presenterId}
|
||||
onPresenterAdvance={() => sendAdvance('SCOREBOARD')}
|
||||
/>
|
||||
) : currentPlayerName ? (
|
||||
<WaitingToRejoin
|
||||
|
|
@ -274,6 +281,8 @@ function App() {
|
|||
onNext={nextQuestion}
|
||||
isHost={role === 'HOST'}
|
||||
currentPlayerId={currentPlayerId}
|
||||
isPresenter={currentPlayerId === presenterId}
|
||||
onPresenterAdvance={() => sendAdvance('NEXT')}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue