File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import PaginationControls from '@/components/pagination/PaginationControls';
99import Dot from '@/components/ui/Dot/Dot' ;
1010import crown from '@/assets/icons/crown.svg' ;
1111import menu from '@/assets/icons/hamburger.svg' ;
12- import { usePathname } from 'next/navigation' ;
12+ import { useParams } from 'next/navigation' ;
1313
1414const ITEMS_PER_PAGE = 15 ;
1515
@@ -33,7 +33,7 @@ export default function SidebarDashboardList({ open, onToggle }: { open: boolean
3333 setPage ( ( prev ) => prev + 1 ) ;
3434 } ;
3535
36- const pathname = usePathname ( ) ;
36+ const params = useParams ( ) ;
3737
3838 return (
3939 < div className = 'flex flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar]:w-1' >
@@ -47,7 +47,7 @@ export default function SidebarDashboardList({ open, onToggle }: { open: boolean
4747 href = { `/dashboard/${ item . id } ` }
4848 className = { cn (
4949 'y-2 flex h-12 min-w-0 items-center gap-3 rounded-lg px-4' ,
50- pathname === `/dashboard/ ${ item . id } ` && 'bg-violet-10 text-violet-20' ,
50+ params . id === String ( item . id ) && 'bg-violet-10 text-violet-20' ,
5151 'hover:bg-violet-10 hover:text-violet-20 md:px-1' ,
5252 ) }
5353 >
You can’t perform that action at this time.
0 commit comments