diff --git a/src/components/MainDrawer.tsx b/src/components/MainDrawer.tsx index 056d67a4..fdb65c38 100644 --- a/src/components/MainDrawer.tsx +++ b/src/components/MainDrawer.tsx @@ -78,40 +78,6 @@ const MainDrawer = ({ permissionCheck(permission) ); - const getPageTitle = useCallback(() => { - let title = ''; - - const activeMenu = MAIN_DRAWER_LINKS.find((item) => - isPathActive(pathname, item.link) - ); - - const traverseMenuTitle = (menu: typeof activeMenu) => { - if (!menu) return; - - const hasSubmenu = menu?.submenu && menu?.submenu.length > 0; - - if (!title) { - title += menu?.text; - } else { - title += ' - ' + menu?.text; - } - - if (!hasSubmenu || !menu.submenu) return; - - const activeSubmenu = menu.submenu?.find((item) => - isPathActive(pathname, item.link) - ); - - traverseMenuTitle(activeSubmenu); - }; - - traverseMenuTitle(activeMenu); - - return title; - }, [pathname]); - - const pageTitle = getPageTitle(); - const toggleSidebar = () => { setMainDrawerOpen(!mainDrawerOpen); }; @@ -132,7 +98,7 @@ const MainDrawer = ({ }} >
- + {children}