From 4780930cd8cbd76d0fe697eeceea5d55bfa74ff5 Mon Sep 17 00:00:00 2001 From: YooJin Lee <113789141+youznn@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:16:14 +0900 Subject: [PATCH] feat(fe): change to contest submit (#1537) * feat: change to contest submit * fix: fix contest type * fix: props type --------- Co-authored-by: dayongkr --- frontend-client/components/EditorHeader.tsx | 6 ++++-- frontend-client/components/EditorResizablePanel.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend-client/components/EditorHeader.tsx b/frontend-client/components/EditorHeader.tsx index 16ac0fe93a..db0386c648 100644 --- a/frontend-client/components/EditorHeader.tsx +++ b/frontend-client/components/EditorHeader.tsx @@ -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(null) @@ -95,7 +96,8 @@ export default function Editor({ problem }: ProblemEditorProps) { ] }, searchParams: { - problemId: problem.id + problemId: problem.id, + ...(contestId && { contestId }) }, next: { revalidate: 0 diff --git a/frontend-client/components/EditorResizablePanel.tsx b/frontend-client/components/EditorResizablePanel.tsx index fe050d90db..90925f9d63 100644 --- a/frontend-client/components/EditorResizablePanel.tsx +++ b/frontend-client/components/EditorResizablePanel.tsx @@ -98,7 +98,7 @@ export default function EditorMainResizablePanel({
- +