From 5528f2507b93bd4e4fd897a8ef8f3db83c4614c2 Mon Sep 17 00:00:00 2001 From: "Sakamoto, Kazunori" Date: Thu, 26 Sep 2024 15:45:42 +0900 Subject: [PATCH] fix: refine layout (#160) Co-authored-by: Sakamoto, Kazunori Co-authored-by: Hikaru Ishiwata <145771843+hishiwat@users.noreply.github.com> Co-authored-by: Hikaru Ishiwata --- .../problems/[problemId]/ProblmBody.tsx | 15 +---- .../problems/[problemId]/pageOnClient.tsx | 63 +++++++++++++------ src/app/(withAuth)/layout.tsx | 2 +- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/ProblmBody.tsx b/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/ProblmBody.tsx index 539254c1..c6c366d2 100644 --- a/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/ProblmBody.tsx +++ b/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/ProblmBody.tsx @@ -143,19 +143,6 @@ export const ProblemBody: React.FC = (props) => { ステップ実行モード )} - {problemType === 'executionResult' && ( - - - - )} @@ -228,7 +215,7 @@ export const ProblemBody: React.FC = (props) => { )} /> - + diff --git a/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/pageOnClient.tsx b/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/pageOnClient.tsx index bb861535..bd1e6eff 100644 --- a/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/pageOnClient.tsx +++ b/src/app/(withAuth)/courses/[courseId]/lectures/[lectureId]/problems/[problemId]/pageOnClient.tsx @@ -10,7 +10,15 @@ import { MIN_INTERVAL_MS_OF_ACTIVE_EVENTS, } from '../../../../../../../../constants'; import { backendTrpcReact } from '../../../../../../../../infrastructures/trpcBackend/client'; -import { Heading, HStack, Link, Text, VStack } from '../../../../../../../../infrastructures/useClient/chakra'; +import { + Button, + Heading, + HStack, + Link, + Text, + Tooltip, + VStack, +} from '../../../../../../../../infrastructures/useClient/chakra'; import type { Problem } from '../../../../../../../../problems/generateProblem'; import type { CourseId, ProblemId } from '../../../../../../../../problems/problemData'; import { courseIdToLectureIds, courseIdToName, problemIdToName } from '../../../../../../../../problems/problemData'; @@ -50,33 +58,50 @@ export const ProblemPageOnClient: React.FC = (props) => { }); }; - const updateProblemSession = async (problemType: string, traceItemIndex: number): Promise => { + const updateProblemSession = async (newProblemType: string, newTraceItemIndex: number): Promise => { const newProblemSession = await updateProblemSessionMutation.mutateAsync({ id: problemSession.id, - problemType, - traceItemIndex, + problemType: newProblemType, + traceItemIndex: newTraceItemIndex, }); setProblemSession(newProblemSession); }; return ( - + - - - {courseIdToName[props.params.courseId]} - - {'>'} - - 第{lectureIndex + 1}回 - + + + + {courseIdToName[props.params.courseId]} + + {'>'} + + 第{lectureIndex + 1}回 + + + + + {problemIdToName[props.params.problemId]} + {problemSession.problemType === 'executionResult' && ( + + + + )} - {problemIdToName[props.params.problemId]} = async ({ children }) => { }> - + {children}