Pull Request branch dev-clone to main #1
|
|
@ -52,15 +52,12 @@ export default function AppNavbar(){
|
||||||
|
|
||||||
return () => window.removeEventListener('resize', handleResize);
|
return () => window.removeEventListener('resize', handleResize);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [activeMenuId, setActiveMenuId] = useState<string>('');
|
|
||||||
|
|
||||||
const handleMenuItemClick = (id: string) => {
|
const handleMenuItemClick = () => {
|
||||||
setActiveMenuId(id);
|
|
||||||
if (window.innerWidth < 768) {
|
if (window.innerWidth < 768) {
|
||||||
setSidebarOpen(false);
|
setSidebarOpen(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import * as TbIcons from "react-icons/tb";
|
import * as TbIcons from "react-icons/tb";
|
||||||
import classNames from "./styles/navbarMenuItem.module.css";
|
// import classNames from "./styles/navbarMenuItem.module.css";
|
||||||
// import dashboardConfig from "../dashboard.config";
|
// import dashboardConfig from "../dashboard.config";
|
||||||
// import { usePathname } from "next/navigation";
|
// import { usePathname } from "next/navigation";
|
||||||
// import areURLsSame from "@/utils/areUrlSame";
|
// import areURLsSame from "@/utils/areUrlSame";
|
||||||
|
|
@ -45,9 +45,9 @@ export default function MenuItem({ menu, isActive, onClick }: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
onClick(menu.link ?? ""); // Notify parent of the active menu item
|
onClick(menu.link ?? "");
|
||||||
if (!hasChildren) {
|
if (!hasChildren) {
|
||||||
toggleOpenMenu(); // Collapse if no children
|
toggleOpenMenu();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user