From 088d4e2e2d80b84eb167481f937c8f1eda230743 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Fri, 18 Oct 2024 12:58:36 +0600 Subject: [PATCH] wip --- src/components/Course/ChallengeView.tsx | 4 +-- src/components/Course/CourseLayout.tsx | 13 +++++++-- src/components/Course/CourseSidebar.tsx | 3 ++- src/components/Course/LessonView.tsx | 4 +-- src/components/Course/QuizView.tsx | 2 +- .../SqlCodeEditor/SqlCodeEditor.tsx | 27 +++++++------------ .../SqlCodeEditor/SqlTableResult.tsx | 8 ------ 7 files changed, 28 insertions(+), 33 deletions(-) diff --git a/src/components/Course/ChallengeView.tsx b/src/components/Course/ChallengeView.tsx index af32ad66f..83c0118c3 100644 --- a/src/components/Course/ChallengeView.tsx +++ b/src/components/Course/ChallengeView.tsx @@ -27,8 +27,7 @@ type ChallengeViewProps = { }; export function ChallengeView(props: ChallengeViewProps) { - const { children, title, course, lesson, courseId, lessonId, chapterId } = - props; + const { children, title, course, lesson, courseId, chapterId } = props; const { chapters } = course; const { frontmatter } = lesson; @@ -39,6 +38,7 @@ export function ChallengeView(props: ChallengeViewProps) { courseId={courseId} chapterId={chapterId} lessonId={lesson.id} + lesson={lesson} title={title} chapters={chapters} completedPercentage={0} diff --git a/src/components/Course/CourseLayout.tsx b/src/components/Course/CourseLayout.tsx index 50c96c820..1b12cf60f 100644 --- a/src/components/Course/CourseLayout.tsx +++ b/src/components/Course/CourseLayout.tsx @@ -3,12 +3,13 @@ import { CourseSidebar, type CourseSidebarProps } from './CourseSidebar'; import { useMemo } from 'react'; type CourseLayoutProps = { + isSubmitted?: boolean; children: React.ReactNode; } & CourseSidebarProps; export function CourseLayout(props: CourseLayoutProps) { - const { children, ...sidebarProps } = props; - const { chapters, courseId, chapterId, lessonId } = sidebarProps; + const { children, isSubmitted, ...sidebarProps } = props; + const { chapters, courseId, chapterId, lessonId, lesson } = sidebarProps; const allLessonLinks = useMemo(() => { const lessons: string[] = []; @@ -51,6 +52,14 @@ export function CourseLayout(props: CourseLayoutProps) { - )}