parent
088d4e2e2d
commit
0abddab414
9 changed files with 171 additions and 222 deletions
@ -1,46 +1,17 @@ |
|||||||
import { useState, type ReactNode } from 'react'; |
import { type ReactNode } from 'react'; |
||||||
import { CourseSidebar } from './CourseSidebar'; |
|
||||||
import { CourseLayout } from './CourseLayout'; |
|
||||||
import { Circle, CircleCheck, CircleX } from 'lucide-react'; |
|
||||||
import { cn } from '../../lib/classname'; |
|
||||||
import type { |
|
||||||
ChapterFileType, |
|
||||||
CourseFileType, |
|
||||||
LessonFileType, |
|
||||||
} from '../../lib/course'; |
|
||||||
|
|
||||||
type LessonViewProps = { |
type LessonViewProps = { |
||||||
courseId: string; |
|
||||||
chapterId: string; |
|
||||||
lessonId: string; |
|
||||||
|
|
||||||
title: string; |
|
||||||
course: CourseFileType & { |
|
||||||
chapters: ChapterFileType[]; |
|
||||||
}; |
|
||||||
lesson: LessonFileType; |
|
||||||
children: ReactNode; |
children: ReactNode; |
||||||
}; |
}; |
||||||
|
|
||||||
export function LessonView(props: LessonViewProps) { |
export function LessonView(props: LessonViewProps) { |
||||||
const { children, title, course, lesson, courseId, chapterId } = props; |
const { children } = props; |
||||||
const { chapters } = course; |
|
||||||
|
|
||||||
return ( |
return ( |
||||||
<CourseLayout |
<div className="relative h-full"> |
||||||
courseId={courseId} |
<div className="absolute inset-0 overflow-y-auto [scrollbar-color:#3f3f46_#27272a;]"> |
||||||
chapterId={chapterId} |
<div className="mx-auto max-w-xl p-4">{children}</div> |
||||||
lessonId={lesson.id} |
|
||||||
lesson={lesson} |
|
||||||
title={title} |
|
||||||
chapters={chapters} |
|
||||||
completedPercentage={0} |
|
||||||
> |
|
||||||
<div className="relative h-full"> |
|
||||||
<div className="absolute inset-0 overflow-y-auto [scrollbar-color:#3f3f46_#27272a;]"> |
|
||||||
<div className="mx-auto max-w-xl p-4">{children}</div> |
|
||||||
</div> |
|
||||||
</div> |
</div> |
||||||
</CourseLayout> |
</div> |
||||||
); |
); |
||||||
} |
} |
||||||
|
@ -0,0 +1,11 @@ |
|||||||
|
import { QueryCache, QueryClient } from '@tanstack/react-query'; |
||||||
|
|
||||||
|
export const queryClient = new QueryClient({ |
||||||
|
queryCache: new QueryCache({}), |
||||||
|
defaultOptions: { |
||||||
|
queries: { |
||||||
|
retry: false, |
||||||
|
enabled: !import.meta.env.SSR, |
||||||
|
}, |
||||||
|
}, |
||||||
|
}); |
Loading…
Reference in new issue