From eda202c6a28d2dbbfc86fafb16b6bef20d836a83 Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Sun, 6 Jul 2025 17:18:51 -0500 Subject: [PATCH] enforce correct lesson order in course sidebar, improve styling and seperation of course sidebar --- .../content/courses/layout/CourseSidebar.js | 10 +- src/pages/course/[slug]/index.js | 111 ++++++++---------- 2 files changed, 51 insertions(+), 70 deletions(-) diff --git a/src/components/content/courses/layout/CourseSidebar.js b/src/components/content/courses/layout/CourseSidebar.js index 7a6af8e..99fc82e 100644 --- a/src/components/content/courses/layout/CourseSidebar.js +++ b/src/components/content/courses/layout/CourseSidebar.js @@ -91,7 +91,7 @@ const CourseSidebar = ({ /> )} -
+
    {lessons.map((lesson, index) => ( @@ -128,13 +128,11 @@ const CourseSidebar = ({ {!isMobileView && sidebarVisible && (
    -
    {/* Adjusted to match new header spacing */} -
    - -
    +
    diff --git a/src/pages/course/[slug]/index.js b/src/pages/course/[slug]/index.js index 5b9542f..245fa16 100644 --- a/src/pages/course/[slug]/index.js +++ b/src/pages/course/[slug]/index.js @@ -226,14 +226,13 @@ const Course = () => { />
- {/* Main content area with fixed width */} -
-
- + {/* Main content area with flex layout */} +
+ {/* Main Content */} +
{/* Overview tab content */}
- { toggleToContentTab={() => toggleTab(1)} // Assuming content tab is at index 1 />
- + {/* Content tab content */}
{!isAuthorized ? ( @@ -266,11 +265,11 @@ const Course = () => {
) : ( - @@ -279,68 +278,52 @@ const Course = () => { {/* QA tab content */}
- +
+ + {/* Mobile: Lessons are a tab */} + {isMobileView && ( +
+ { + setSidebarVisible(false); + toggleTab(getActiveTabIndex()); + }} + sidebarVisible={sidebarVisible} + setSidebarVisible={setSidebarVisible} + hideToggleButton={true} + /> +
+ )}
- {/* Course Sidebar - positioned absolutely on desktop when visible */} - {!isMobileView ? ( -
- -
- ) : ( -
- { - setSidebarVisible(false); - toggleTab(getActiveTabIndex()); - }} - sidebarVisible={sidebarVisible} - setSidebarVisible={setSidebarVisible} - hideToggleButton={true} - /> + {sidebarVisible && ( + + )}
)}