Skip to content

Commit

Permalink
add admin button segment result
Browse files Browse the repository at this point in the history
  • Loading branch information
jajakob committed Aug 22, 2024
1 parent 361c7e0 commit 4b9fc34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/demo-game/src/pages/admin/games/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function ManageGame() {

const isScheduled = game.status === GameStatus.Scheduled
const isResultState = game.status === GameStatus.Results
const isPrepared = game.status === GameStatus.Preparation

if (!activePeriod) {
return <Button onClick={nextPeriod}>Start Period</Button>
}
Expand All @@ -109,10 +109,12 @@ function ManageGame() {
}

const atLastSegment = activeSegmentIx >= segments.length - 1
if (!atLastSegment || isPrepared) {
if (!atLastSegment) {
const isPaused = game.status === GameStatus.Paused
const isPrepared = game.status === GameStatus.Preparation
return (
<Button disabled={nextSegmentLoading} onClick={nextSegment}>
Next Segment
{isPaused || isPrepared ? 'Next Segment' : 'Segment Results'}
</Button>
)
}
Expand Down

0 comments on commit 4b9fc34

Please sign in to comment.