From f69b6192884590620d6644de4996299d0977ad73 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 15 Nov 2024 10:35:42 -0700 Subject: [PATCH] Light mode and UI changes --- src/components/Course/Chapter.tsx | 71 +++++++++++++------ src/components/Course/CourseLayout.tsx | 6 +- src/components/Course/CourseSidebar.tsx | 24 +++---- src/components/Course/CourseView.tsx | 2 +- src/components/Resizable.tsx | 6 +- .../introduction/lessons/intro-to-sql.md | 12 ++++ src/styles/global.css | 7 +- 7 files changed, 82 insertions(+), 46 deletions(-) diff --git a/src/components/Course/Chapter.tsx b/src/components/Course/Chapter.tsx index 7acd99870..cfad8144c 100644 --- a/src/components/Course/Chapter.tsx +++ b/src/components/Course/Chapter.tsx @@ -7,6 +7,12 @@ import { CheckIcon } from '../ReactIcons/CheckIcon'; import { getPercentage } from '../../helper/number'; import { useIsMounted } from '../../hooks/use-is-mounted'; +function LeftBorder() { + return ( + + ); +} + type ChapterProps = ChapterFileType & { index: number; isActive?: boolean; @@ -76,31 +82,33 @@ export function Chapter(props: ChapterProps) {
{isActive && ( -
+
{lessons.length > 0 && ( <>
-
- {lessons.map((lesson) => { + {lessons.map((lesson, counter) => { const isActive = activeLessonId === lesson.id && chapterId === activeChapterId; const isCompleted = completedLessonSet.has(`${chapterId}/${lesson.id}`); return ( -
- {isCompleted && } - {isLoading && isMounted && ( - +
+ {counter}
- {title} + {title} + + {isCompleted && ( +
+ +
+ )} - + {!isActive && } ); } diff --git a/src/components/Course/CourseLayout.tsx b/src/components/Course/CourseLayout.tsx index b95e55695..00413614f 100644 --- a/src/components/Course/CourseLayout.tsx +++ b/src/components/Course/CourseLayout.tsx @@ -1,6 +1,6 @@ import { ChevronLeft, ChevronRight, Loader2 } from 'lucide-react'; import { CourseSidebar, type CourseSidebarProps } from './CourseSidebar'; -import { useEffect, useMemo, useState } from 'react'; +import {type ReactNode, useEffect, useMemo, useState} from 'react'; import { useCompleteLessonMutation, useCourseProgress, @@ -14,7 +14,7 @@ import { CourseNotes } from '../CourseNotes/CourseNotes'; import { CourseAI } from '../CourseAI/CourseAI'; export type CourseLayoutProps = { - children: React.ReactNode; + children: ReactNode; } & Omit; export function CourseLayout(props: CourseLayoutProps) { @@ -123,7 +123,7 @@ export function CourseLayout(props: CourseLayoutProps) {
-
-

{title}

- -
- {completedPercentage}% Completed -
-
-
+