sidebar change
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-07-19 09:17:12 +03:30
parent a335f2b66c
commit 1fb0091aa2
25 changed files with 1008 additions and 1376 deletions
+57 -9
View File
@@ -1,11 +1,59 @@
export const SideBarItemHasSubMenu = [
"services",
"customers",
"receipts",
"users",
"tickets",
"learning",
"blog",
"support",
"accessLogs",
"menu",
"financial",
"other",
"content",
"reseller",
"dmenu",
"dkala",
"dpage",
"dmail",
];
const pathSegmentToSubMenu: Record<string, string> = {
dashboard: "menu",
services: "menu",
support: "menu",
customers: "menu",
representatives: "menu",
developers: "menu",
payments: "menu",
"referral-code": "menu",
users: "menu",
sliders: "menu",
subscriptions: "financial",
receipts: "financial",
transactions: "financial",
discounts: "financial",
"card-bank": "financial",
tickets: "other",
feedback: "other",
"access-logs": "other",
criticisms: "other",
workspace: "other",
project: "other",
taskmanager: "other",
ads: "content",
announcement: "content",
blog: "content",
learning: "content",
messages: "content",
reseller: "reseller",
dmenu: "dmenu",
dkala: "dkala",
dpage: "dpage",
dmail: "dmail",
};
export const getSubMenuNameFromPath = (pathname: string): string => {
if (pathname.startsWith("/customers/subscriptions")) {
return "financial";
}
if (pathname.startsWith("/workspace") || pathname.startsWith("/project") || pathname.startsWith("/taskmanager")) {
return "other";
}
const segment = pathname.split("/")[1] ?? "";
return pathSegmentToSubMenu[segment] ?? "";
};