diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-28 15:04:21 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-28 15:04:47 +0900 |
| commit | 2794e9de67781614edc17336b284266d3e4a740c (patch) | |
| tree | a1fe37cc341f8ad5db90088f8c9bd096f8ea978c /frontend/app/components/GolfPlayApp.tsx | |
| parent | cf72673a8b09cb679d8dd80650d7f972af78d6f8 (diff) | |
| download | phperkaigi-2026-albatross-2794e9de67781614edc17336b284266d3e4a740c.tar.gz phperkaigi-2026-albatross-2794e9de67781614edc17336b284266d3e4a740c.tar.zst phperkaigi-2026-albatross-2794e9de67781614edc17336b284266d3e4a740c.zip | |
feat(admin): allow admin users to view and submit code before game starts
Admin users can now access the gaming UI (problem description, code
editor, submit button) even when a game has not started yet. Regular
users still see the waiting screen as before.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend/app/components/GolfPlayApp.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApp.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/frontend/app/components/GolfPlayApp.tsx b/frontend/app/components/GolfPlayApp.tsx index 6c77f8c..1c1e7ae 100644 --- a/frontend/app/components/GolfPlayApp.tsx +++ b/frontend/app/components/GolfPlayApp.tsx @@ -121,6 +121,22 @@ export default function GolfPlayApp({ game, player, initialGameState }: Props) { if (gameStateKind === "loading") { return <GolfPlayAppLoading />; } else if (gameStateKind === "waiting") { + if (player.is_admin) { + return ( + <GolfPlayAppGaming + gameDisplayName={game.display_name} + playerProfile={playerProfile} + problemTitle={game.problem.title} + problemDescription={game.problem.description} + problemLanguage={game.problem.language} + sampleCode={game.problem.sample_code} + initialCode={initialGameState.code} + onCodeChange={onCodeChange} + onCodeSubmit={onCodeSubmit} + isFinished={false} + /> + ); + } return ( <GolfPlayAppWaiting gameDisplayName={game.display_name} |
