Skip to content

Commit

Permalink
feat(fe): change to contest submit (#1537)
Browse files Browse the repository at this point in the history
* feat: change to contest submit

* fix: fix contest type

* fix: props type

---------

Co-authored-by: dayongkr <[email protected]>
  • Loading branch information
youznn and dayongkr authored Mar 3, 2024
1 parent 1c77b5c commit 4780930
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions frontend-client/components/EditorHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ import { toast } from 'sonner'

interface ProblemEditorProps {
problem: ProblemDetail
contestId?: number
}

export default function Editor({ problem }: ProblemEditorProps) {
export default function Editor({ problem, contestId }: ProblemEditorProps) {
const { code, language, clearCode, setLanguage } = useEditorStore()
const [loading, setLoading] = useState(false)
const [submissionId, setSubmissionId] = useState<number | null>(null)
Expand Down Expand Up @@ -95,7 +96,8 @@ export default function Editor({ problem }: ProblemEditorProps) {
]
},
searchParams: {
problemId: problem.id
problemId: problem.id,
...(contestId && { contestId })
},
next: {
revalidate: 0
Expand Down
2 changes: 1 addition & 1 deletion frontend-client/components/EditorResizablePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function EditorMainResizablePanel({

<ResizablePanel defaultSize={65} className="bg-slate-900">
<div className="grid-rows-editor grid h-full">
<EditorHeader problem={problem} />
<EditorHeader problem={problem} contestId={contestId} />
<CodeEditor
value={code}
language={language as Language}
Expand Down

0 comments on commit 4780930

Please sign in to comment.