feat/course
Kamran Ahmed 7 days ago
parent d2734b0059
commit 8e5adc6295
  1. 8
      src/components/Course/CertificateView.tsx
  2. 4
      src/components/Course/Chapter.tsx
  3. 5
      src/components/Course/CourseSidebar.tsx
  4. 2
      src/data/courses/sql/chapters/introduction/lessons/challenge-1.md
  5. 13
      src/pages/learn/[courseId]/[chapterId]/[lessonId]/index.astro

@ -175,10 +175,10 @@ export function CertificateView(props: CertificateViewProps) {
{!isCourseCompleted && !isLoading && ( {!isCourseCompleted && !isLoading && (
<div className="flex flex-col items-center"> <div className="flex flex-col items-center">
<h1 className="text-4xl font-semibold">Almost there!</h1> <h1 className="text-4xl font-semibold">Pending completion!</h1>
<p className="mt-3 text-center text-lg text-zinc-200"> <p className="mt-3 text-center text-lg text-gray-600">
Complete the course to download the certificate and rate your Please complete all the lessons and challenges in the course to
experience. issue the certificate.
</p> </p>
</div> </div>
)} )}

@ -94,9 +94,9 @@ export function Chapter(props: ChapterProps) {
<div> <div>
<button <button
className={cn( className={cn(
'relative z-10 flex w-full flex-row items-center gap-2 border-b px-2 py-4 text-base text-gray-600', 'relative z-10 flex w-full flex-row items-center gap-2 border-b px-2 py-4 text-base text-gray-600 hover:bg-gray-100',
{ {
'text-black': isActive, 'text-black hover:bg-gray-50': isActive,
}, },
)} )}
onClick={onChapterClick} onClick={onChapterClick}

@ -3,6 +3,7 @@ import type { ChapterFileType, LessonFileType } from '../../lib/course';
import { Chapter } from './Chapter'; import { Chapter } from './Chapter';
import { StickyNote, ChevronLeft } from 'lucide-react'; import { StickyNote, ChevronLeft } from 'lucide-react';
import { ProgressPercentageSkeleton } from './CourseSkeletons'; import { ProgressPercentageSkeleton } from './CourseSkeletons';
import { cn } from '../../lib/classname';
export type CourseSidebarProps = { export type CourseSidebarProps = {
isLoading: boolean; isLoading: boolean;
@ -87,7 +88,9 @@ export function CourseSidebar(props: CourseSidebarProps) {
})} })}
<a <a
className="flex items-center gap-2 p-2 text-sm text-zinc-500 hover:bg-zinc-800 hover:text-white" className={cn("flex items-center py-4 px-4 gap-2 text-base text-zinc-500 hover:bg-gray-200 hover:text-black", {
"bg-gray-200": false,
})}
href={certificateUrl} href={certificateUrl}
> >
<StickyNote className="h-4 w-4 stroke-[2.5]" /> <StickyNote className="h-4 w-4 stroke-[2.5]" />

@ -33,8 +33,6 @@ expectedResults:
- [5] - [5]
--- ---
## Instructions
Write a SQL query to find the total number of orders in the `orders` table. Write a SQL query to find the total number of orders in the `orders` table.
## Result ## Result

@ -2,11 +2,11 @@
import { CourseView } from '../../../../../components/Course/CourseView'; import { CourseView } from '../../../../../components/Course/CourseView';
import SkeletonLayout from '../../../../../layouts/SkeletonLayout.astro'; import SkeletonLayout from '../../../../../layouts/SkeletonLayout.astro';
import { import {
getAllCourses, getAllCourses,
getChaptersByCourseId, getChaptersByCourseId,
type CourseFileType, type ChapterFileType,
type ChapterFileType, type CourseFileType,
type LessonFileType, type LessonFileType,
} from '../../../../../lib/course'; } from '../../../../../lib/course';
interface Params extends Record<string, string | undefined> { interface Params extends Record<string, string | undefined> {
@ -64,7 +64,7 @@ export async function getStaticPaths() {
} }
const { courseId, chapterId } = Astro.params; const { courseId, chapterId } = Astro.params;
const { course, chapter, lesson } = Astro.props; const { course, lesson } = Astro.props;
--- ---
<SkeletonLayout title={course.frontmatter.title}> <SkeletonLayout title={course.frontmatter.title}>
@ -75,6 +75,7 @@ const { course, chapter, lesson } = Astro.props;
lesson={lesson} lesson={lesson}
title={course.frontmatter.title} title={course.frontmatter.title}
chapters={course.chapters} chapters={course.chapters}
isLoading={false}
client:load client:load
> >
<lesson.Content /> <lesson.Content />

Loading…
Cancel
Save