@@ -7,13 +7,15 @@ import { Separator } from "@/components/ui/Separator";
77import { Link } from "@/lib/navigation" ;
88import { useAuthUser } from "@/components/hooks/UseAuthUser" ;
99import ProtectedRoute from "@/components/layout/ProtectedRoute" ;
10+ import { usePathname } from "@/lib/navigation" ;
1011
1112interface UserLayoutProps {
1213 children : React . ReactNode ;
1314}
1415
1516export default function UserLayout ( { children } : UserLayoutProps ) {
1617 const { user } = useAuthUser ( ) ;
18+ const pathname = usePathname ( ) ;
1719
1820 return (
1921 < ProtectedRoute >
@@ -33,11 +35,24 @@ export default function UserLayout({ children }: UserLayoutProps) {
3335
3436 < Separator />
3537
38+ { /* TODO: Refactor to use constant list for better maintainability
39+ Should create a navigationItems array with { href, label, icon, isActive }
40+ instead of hardcoding each link with pathname checks */ }
3641 < nav className = "flex flex-col gap-3 text-sm" >
37- < Link href = "/my-events" className = "flex items-center gap-2 text-gray-800 transition hover:text-blue-600" >
42+ < Link
43+ href = "/my-events"
44+ className = { `flex items-center gap-2 transition hover:text-blue-600 ${
45+ pathname . includes ( "/my-events" ) ? "text-hmc-base-blue" : "text-foreground"
46+ } `}
47+ >
3848 < Calendar1 size = { 16 } /> My Events
3949 </ Link >
40- < Link href = "/profile" className = "flex items-center gap-2 text-gray-800 transition hover:text-blue-600" >
50+ < Link
51+ href = "/profile"
52+ className = { `flex items-center gap-2 transition hover:text-blue-600 ${
53+ pathname . includes ( "/profile" ) ? "text-hmc-base-blue" : "text-foreground"
54+ } `}
55+ >
4156 < User size = { 16 } /> Profil
4257 </ Link >
4358 </ nav >
0 commit comments