feat: add setOpen functionality to SidebarItem for improved menu interaction
This commit is contained in:
parent
2f304684f3
commit
1e9d5c2742
@ -141,6 +141,7 @@ export const Sidebar = ({
|
||||
href={item.href}
|
||||
title={item.title}
|
||||
icon={item.icon}
|
||||
setOpen={setOpen}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
|
@ -6,16 +6,21 @@ export const SidebarItem = ({
|
||||
title,
|
||||
icon,
|
||||
href,
|
||||
setOpen,
|
||||
}: {
|
||||
title: string;
|
||||
icon: React.ReactNode;
|
||||
href: string;
|
||||
setOpen: (open: boolean) => void;
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<Link
|
||||
onPress={() => router.push(href)}
|
||||
onPress={() => {
|
||||
router.push(href);
|
||||
setOpen(false);
|
||||
}}
|
||||
color="foreground"
|
||||
className="w-full p-2 gap-3 text-md"
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user