Skip to content

Commit

Permalink
feat: add waiting for submission ready status
Browse files Browse the repository at this point in the history
  • Loading branch information
frimoldi committed Jan 13, 2023
1 parent 9600870 commit 86f5eaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hooks/api/admin/useAdminContests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type ContestsListItem = {
dashboardID?: string
startDate: number
endDate: number
submissionReady: boolean
}

type GetAdminContestsResponse = {
Expand All @@ -31,6 +32,7 @@ type GetAdminContestsResponse = {
dashboard_id: string
starts_at: number
ends_at: number
protocol_submission_ready: boolean
}[]

export const adminContestsQuery = () => "admin-contests"
Expand All @@ -50,5 +52,6 @@ export const useAdminContests = () =>
dashboardID: d.dashboard_id,
startDate: d.starts_at,
endDate: d.ends_at,
submissionReady: d.protocol_submission_ready,
}))
})
4 changes: 4 additions & 0 deletions src/pages/admin/AdminContestsList/AdminContestsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export const AdminContestsList = () => {
return <Text variant="secondary">Waiting on full payment</Text>
}

if (contest.status === "CREATED" && !contest.submissionReady) {
return <Text variant="secondary">Waiting for protocol to finalize submission</Text>
}

if (contest.status === "CREATED" && !contest.adminStartApproved) {
return <Text variant="secondary">Ready to approve start</Text>
}
Expand Down

0 comments on commit 86f5eaa

Please sign in to comment.