Skip to content

Commit

Permalink
Add event state to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
rorre committed Sep 8, 2023
1 parent 44d3526 commit f5bbd5a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/components/module/dashboard/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,18 @@ export default function DashboardLayout({

return (
<div>
<h1 className="ml-4 py-4 text-2xl font-bold">{contest.event_name}</h1>
<div className="p-4 flex flex-row justify-between">
<h1 className="text-2xl font-bold">{contest.event_name}</h1>
<strong className="font-bold text-2xl">
{contest.event_status.state === "finished"
? "Event Finished!"
: contest.event_status.state === "not started"
? "Not Started"
: contest.event_status.state === "running"
? `Round: ${contest.event_status.current_round} / Tick: ${contest.event_status.current_tick}`
: "Unknown event state"}
</strong>
</div>
<div className="flex flex-row gap-8">
<div className="flex flex-col gap-2 basis-[24rem]">
<ConfigMenu
Expand Down
5 changes: 4 additions & 1 deletion src/types/contest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
type EventState =
| {
state: "not started" | "finished";
state: "not started";
}
| {
state: "finished";
}
| {
state: "running";
Expand Down

0 comments on commit f5bbd5a

Please sign in to comment.