-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fe): change index based number to letter (#1533)
* refactor: change converToLetter logic * fix: change number base to letter base in dropdown * fix: change number base to letter base in description * fix: add contest feature in problem tab
- Loading branch information
Showing
8 changed files
with
70 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
frontend-client/app/contest/[contestId]/problem/[problemId]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
import { EditorDescription } from '@/components/EditorDescription' | ||
import { fetcher } from '@/lib/utils' | ||
import type { ProblemDetail } from '@/types/type' | ||
import { fetcher, fetcherWithAuth } from '@/lib/utils' | ||
import type { ContestProblem, ProblemDetail } from '@/types/type' | ||
|
||
export default async function DescriptionPage({ | ||
params | ||
}: { | ||
params: { problemId: number } | ||
params: { problemId: number; contestId: number } | ||
}) { | ||
const { problemId } = params | ||
const problem: ProblemDetail = await fetcher(`problem/${problemId}`).json() | ||
|
||
return <EditorDescription problem={problem} /> | ||
const contestProblems: { problems: ContestProblem[] } = await fetcherWithAuth( | ||
`contest/${params.contestId}/problem` | ||
).json() | ||
return ( | ||
<EditorDescription | ||
problem={problem} | ||
contestProblems={contestProblems.problems} | ||
/> | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
frontend-client/app/contest/[contestId]/problem/[problemOrder]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import EditorLayout from '@/components/EditorLayout' | ||
|
||
export default async function layout({ | ||
params, | ||
children | ||
}: { | ||
params: { problemId: number; contestId: number } | ||
children: React.ReactNode | ||
}) { | ||
const { problemId, contestId } = params | ||
|
||
return ( | ||
<EditorLayout problemId={problemId} contestId={contestId}> | ||
{children} | ||
</EditorLayout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters