generated from Luis/nextjs-python-web-template
[Layout] Modify the Entities to be in a collapsible submenu
- small fix for window pathname
This commit is contained in:
@@ -83,7 +83,7 @@ interface SidebarProps {
|
||||
|
||||
export function Sidebar(props: SidebarProps) {
|
||||
const {show, onClose} = props;
|
||||
const [activeMenuItem, setActiveMenuItem] = React.useState(window.location.pathname);
|
||||
const [activeMenuItem, setActiveMenuItem] = React.useState(typeof window !== "undefined" ? window.location.pathname : "");
|
||||
const [collapseMenuOpen, setCollapseMenuOpen] = React.useState(true);
|
||||
|
||||
const handleCollapseClick = () => {
|
||||
|
||||
Reference in New Issue
Block a user