From fcb50a02dea6814965658d35c86d7357e7607939 Mon Sep 17 00:00:00 2001 From: hady Date: Tue, 10 Sep 2024 00:25:22 +0530 Subject: [PATCH] Adds active menu highlight && fixes few minor UI bugs --- .husky/pre-commit | 3 --- src/components/Appbar.tsx | 2 +- src/components/CourseCard.tsx | 5 +---- src/components/Sidebar.tsx | 2 +- src/components/ui/sidebar-items.tsx | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index d663f7203..a0fdd5db8 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,3 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - npm run format:fix npm run lint:fix diff --git a/src/components/Appbar.tsx b/src/components/Appbar.tsx index 1d9bdf63f..8fd45ad31 100644 --- a/src/components/Appbar.tsx +++ b/src/components/Appbar.tsx @@ -69,7 +69,7 @@ export const Appbar = () => { className="fixed left-0 top-0 z-[999] hidden h-full flex-col border-r border-primary/10 bg-background dark:bg-background 2xl:flex" >
-
+
{!isCollapsed && ( <>

diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index 720d51056..1e57f2afe 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -13,10 +13,7 @@ export const CourseCard = ({ onClick: () => void; }) => { const router = useRouter(); - const imageUrl = - course.imageUrl - ? course.imageUrl - : 'banner_placeholder.png'; + const imageUrl = course.imageUrl ? course.imageUrl : 'banner_placeholder.png'; return (
-
+

Course Content

diff --git a/src/components/ui/sidebar-items.tsx b/src/components/ui/sidebar-items.tsx index 7e5818278..d2608daa3 100644 --- a/src/components/ui/sidebar-items.tsx +++ b/src/components/ui/sidebar-items.tsx @@ -25,7 +25,7 @@ export const SidebarItems = ({ return ( <> {items.map((item) => { - const isActive = pathname === item.href; + const isActive = pathname.startsWith(item.href); return (