From 2a8811e9dcf1673789098a17800fee03b6c8e09b Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 25 Jan 2026 08:18:12 -0700 Subject: [PATCH] Fix screen issues --- components/Lobby.tsx | 105 +++++++++++++----- components/RevealScreen.tsx | 207 ++++++++++++++++++------------------ 2 files changed, 180 insertions(+), 132 deletions(-) diff --git a/components/Lobby.tsx b/components/Lobby.tsx index c86e229..c6840cd 100644 --- a/components/Lobby.tsx +++ b/components/Lobby.tsx @@ -254,38 +254,85 @@ export const Lobby: React.FC = ({ quizTitle, players, gamePin, role, ) : ( -
- - {isPresenter && ( -
- +
+
+ + {isPresenter && ( +
+ +
+ )} + {currentPlayer ? ( + + ) : ( + + )} +
+

+ {currentPlayer?.name || "You're in!"} +

+ {isPresenter ? ( +
+ + + You are the Presenter + +

You can advance screens during the game

- )} - {currentPlayer ? ( - ) : ( - +

Waiting for the host to start...

)} - -

- {currentPlayer?.name || "You're in!"} -

- {isPresenter ? ( -
- - - You are the Presenter - -

You can advance screens during the game

+
+ + {/* Player list */} +
+
+ {players.length} Player{players.length !== 1 ? 's' : ''} Connected
- ) : ( -

Waiting for the host to start...

- )} +
+
+ + {players.map((player) => { + const isCurrentPlayer = player.id === currentPlayerId; + const isPlayerHost = player.id === 'host'; + const isPlayerPresenter = player.id === presenterId; + return ( + + {isPlayerPresenter && !isPlayerHost && ( + + )} + + {player.name} + {isPlayerHost && ( + HOST + )} + {isCurrentPlayer && !isPlayerHost && ( + YOU + )} + + ); + })} + +
+
+
{onLeaveGame && ( = ({ quizTitle, players, gamePin, role, animate={{ y: 0, opacity: 1 }} transition={{ delay: 0.3 }} onClick={onLeaveGame} - className="mt-8 bg-white/20 hover:bg-white/30 text-white px-6 py-3 rounded-full font-bold flex items-center gap-2 transition-all active:scale-95" + className="fixed bottom-4 md:bottom-8 bg-white/20 hover:bg-white/30 text-white px-6 py-3 rounded-full font-bold flex items-center gap-2 transition-all active:scale-95" > Leave Game diff --git a/components/RevealScreen.tsx b/components/RevealScreen.tsx index 6845c9d..41c7f4d 100644 --- a/components/RevealScreen.tsx +++ b/components/RevealScreen.tsx @@ -129,11 +129,12 @@ export const RevealScreen: React.FC = ({ // -- CLIENT VIEW -- const bgColor = isCorrect ? 'bg-[#22c55e]' : 'bg-[#ef4444]'; - const darkerColor = isCorrect ? 'bg-[#15803d]' : 'bg-[#b91c1c]'; const ShapeIcon = SHAPES[correctOption.shape]; + const showContinueButton = (isHost && onNext) || (!isHost && isPresenter && onPresenterAdvance); + const handleContinue = isHost ? onNext : onPresenterAdvance; return ( -
+
{/* Dynamic Background Circles */} = ({ className="absolute w-[800px] h-[800px] bg-white rounded-full blur-3xl opacity-10 pointer-events-none" /> - -
- {isCorrect ? ( - - ) : ( - - )} -
- -

- {isCorrect ? "Correct!" : "Incorrect"} -

- - + - {isCorrect ? ( -
-
- +{pointsEarned} - Points -
- {correctOption.reason && ( -

- {correctOption.reason} -

- )} -
- ) : ( -
- Don't worry, you can catch up in the next round! -
- )} +
+ {isCorrect ? ( + + ) : ( + + )} +
- {/* Streak Indicator */} - {streak > 1 && isCorrect && ( -
- - Answer Streak: {streak} -
- )} - -
- Total Score: -
-
+

+ {isCorrect ? "Correct!" : "Incorrect"} +

- -
- - {!isCorrect && ( -
- - {selectedOption && selectedOption.reason && ( -
-

Why your answer was wrong

-

- {selectedOption.reason} -

+ + {isCorrect ? ( +
+
+ +{pointsEarned} + Points +
+ {correctOption.reason && ( +

+ {correctOption.reason} +

+ )}
- )} -

The correct answer was

-
-
-
- -
- {correctOption.text} -
- {correctOption.reason && ( -

- {correctOption.reason} -

- )} -
-
-
- )} + ) : ( +
+ Don't worry, you'll get the next one! +
+ )} - {/* Host participating gets the continue button */} - {isHost && onNext && ( - 1 && isCorrect && ( +
+ + Answer Streak: {streak} +
+ )} + +
+ Total Score: +
+
+ +
+ + {/* Bottom sheet for incorrect answers - includes button inside */} + {!isCorrect && ( + - Continue to Scoreboard - - + {selectedOption && selectedOption.reason && ( +
+

Why your answer was wrong

+

+ {selectedOption.reason} +

+
+ )} +

The correct answer was

+
+
+
+ +
+ {correctOption.text} +
+ {correctOption.reason && ( +

+ {correctOption.reason} +

+ )} +
+ + {/* Continue button inside bottom sheet for incorrect answers */} + {showContinueButton && ( + + Continue to Scoreboard + + + )} +
)} - {/* Presenter (non-host) gets the continue button */} - {!isHost && isPresenter && onPresenterAdvance && ( + {/* Continue button for correct answers - fixed at bottom */} + {isCorrect && showContinueButton && ( Continue to Scoreboard