update sidebar

This commit is contained in:
hamid zarghami
2026-07-19 11:32:33 +03:30
parent 2b338d53b1
commit 44fd61c039
2 changed files with 18 additions and 0 deletions
+4
View File
@@ -43,6 +43,10 @@ export const getSubMenuNameFromPath = (pathname: string): string => {
return "customers";
}
if (pathname.startsWith("/workspace") || pathname.startsWith("/project") || pathname.startsWith("/taskmanager")) {
return "other";
}
const segment = pathname.split("/")[1] ?? "";
return pathSegmentToSubMenu[segment] ?? "";
};
+14
View File
@@ -12,6 +12,15 @@ const OtherSubMenu: FC = () => {
const isActive = (name: string) => location.pathname.includes(name);
const isTaskManagerActive =
location.pathname.startsWith(Pages.taskmanager.workspace) ||
location.pathname === Pages.taskmanager.workspaceList ||
location.pathname.startsWith(Pages.taskmanager.updateWorkspace) ||
location.pathname === Pages.taskmanager.createWorkspace ||
location.pathname === Pages.taskmanager.createProject ||
location.pathname.startsWith(Pages.taskmanager.updateProject) ||
location.pathname.startsWith(Pages.taskmanager.projectList);
return (
<div className="py-12">
<div className="flex gap-3 items-center border-b pb-10 px-6">
@@ -70,6 +79,11 @@ const OtherSubMenu: FC = () => {
link={Pages.messages.list}
activeName="contacts_us"
/>
<SubMenuItem
title={t("sidebar.taskmanager")}
isActive={isTaskManagerActive}
link={Pages.taskmanager.workspaceList}
/>
</div>
</div>
);