Skip to content

Commit

Permalink
refactor: fix name problem -> program (#35)
Browse files Browse the repository at this point in the history
Co-authored-by: Kento Sato <[email protected]>
  • Loading branch information
ykit00 and Tatehito authored Feb 13, 2024
1 parent 22049f1 commit 304f2be
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/(withAuth)/courses/[courseId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const CoursePage: NextPage<{ params: { courseId: string } }> = ({ params }) => {
<OrderedList>
{programIds.map((programId) => (
<ListItem key={programId}>
<NextLink passHref href={`/problems/${programId}`}>
<NextLink passHref href={`/programs/${programId}`}>
{programIdToName[programId]}
</NextLink>
</ListItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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) {
Expand Down Expand Up @@ -74,7 +74,7 @@ const ProblemPage: NextPage<{ params: { problemId: string } }> = ({ params }) =>
return (
<main>
<VStack spacing="4">
<Heading as="h1">{programIdToName[problemId]}</Heading>
<Heading as="h1">{programIdToName[programId]}</Heading>
<ProblemComponent />
</VStack>
</main>
Expand Down

0 comments on commit 304f2be

Please sign in to comment.