From 304f2be88f9c9b72103aadab23f58f170343bdd0 Mon Sep 17 00:00:00 2001 From: Yuki Ito <37338201+ykit00@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:36:47 +0900 Subject: [PATCH] refactor: fix name problem -> program (#35) Co-authored-by: Kento Sato --- src/app/(withAuth)/courses/[courseId]/page.tsx | 2 +- .../[programId]}/CheckpointProblem.tsx | 0 .../[programId]}/ExecutionResultProblem.tsx | 0 .../[programId]}/StepProblem.tsx | 0 .../[problemId] => programs/[programId]}/page.tsx | 10 +++++----- 5 files changed, 6 insertions(+), 6 deletions(-) rename src/app/(withAuth)/{problems/[problemId] => programs/[programId]}/CheckpointProblem.tsx (100%) rename src/app/(withAuth)/{problems/[problemId] => programs/[programId]}/ExecutionResultProblem.tsx (100%) rename src/app/(withAuth)/{problems/[problemId] => programs/[programId]}/StepProblem.tsx (100%) rename src/app/(withAuth)/{problems/[problemId] => programs/[programId]}/page.tsx (90%) diff --git a/src/app/(withAuth)/courses/[courseId]/page.tsx b/src/app/(withAuth)/courses/[courseId]/page.tsx index 5e40d815..f4971160 100644 --- a/src/app/(withAuth)/courses/[courseId]/page.tsx +++ b/src/app/(withAuth)/courses/[courseId]/page.tsx @@ -71,7 +71,7 @@ const CoursePage: NextPage<{ params: { courseId: string } }> = ({ params }) => { {programIds.map((programId) => ( - + {programIdToName[programId]} diff --git a/src/app/(withAuth)/problems/[problemId]/CheckpointProblem.tsx b/src/app/(withAuth)/programs/[programId]/CheckpointProblem.tsx similarity index 100% rename from src/app/(withAuth)/problems/[problemId]/CheckpointProblem.tsx rename to src/app/(withAuth)/programs/[programId]/CheckpointProblem.tsx diff --git a/src/app/(withAuth)/problems/[problemId]/ExecutionResultProblem.tsx b/src/app/(withAuth)/programs/[programId]/ExecutionResultProblem.tsx similarity index 100% rename from src/app/(withAuth)/problems/[problemId]/ExecutionResultProblem.tsx rename to src/app/(withAuth)/programs/[programId]/ExecutionResultProblem.tsx diff --git a/src/app/(withAuth)/problems/[problemId]/StepProblem.tsx b/src/app/(withAuth)/programs/[programId]/StepProblem.tsx similarity index 100% rename from src/app/(withAuth)/problems/[problemId]/StepProblem.tsx rename to src/app/(withAuth)/programs/[programId]/StepProblem.tsx diff --git a/src/app/(withAuth)/problems/[problemId]/page.tsx b/src/app/(withAuth)/programs/[programId]/page.tsx similarity index 90% rename from src/app/(withAuth)/problems/[problemId]/page.tsx rename to src/app/(withAuth)/programs/[programId]/page.tsx index 31a773e8..e26f94f7 100644 --- a/src/app/(withAuth)/problems/[problemId]/page.tsx +++ b/src/app/(withAuth)/programs/[programId]/page.tsx @@ -12,8 +12,8 @@ import { CheckpointProblem } from './CheckpointProblem'; import { ExecutionResultProblem } from './ExecutionResultProblem'; import { StepProblem } from './StepProblem'; -const ProblemPage: NextPage<{ params: { problemId: string } }> = ({ params }) => { - const problemId = params.problemId; +const ProblemPage: NextPage<{ params: { programId: string } }> = ({ params }) => { + const programId = params.programId; // TODO: チェックポイントを取得する処理が実装できたら置き換える const checkPointLines = [1, 4]; @@ -28,8 +28,8 @@ const ProblemPage: NextPage<{ params: { problemId: string } }> = ({ params }) => }, []); useEffect(() => { - setProblemProgram(generateProgram(problemId, selectedLanguageId)); - }, [problemId, selectedLanguageId]); + setProblemProgram(generateProgram(programId, selectedLanguageId)); + }, [programId, selectedLanguageId]); const ProblemComponent: React.FC = () => { switch (step) { @@ -74,7 +74,7 @@ const ProblemPage: NextPage<{ params: { problemId: string } }> = ({ params }) => return (
- {programIdToName[problemId]} + {programIdToName[programId]}