Add presenter role for game flow control

This commit is contained in:
Joey Yakimowich-Payne 2026-01-19 14:02:28 -07:00
commit 9ef8f7343d
No known key found for this signature in database
GPG key ID: DDF6AF5B21B407D4
10 changed files with 1412 additions and 17 deletions

11
App.tsx
View file

@ -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}