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

This commit is contained in:
hamid zarghami
2026-07-19 11:09:22 +03:30
parent 1fb0091aa2
commit 2b338d53b1
16 changed files with 544 additions and 617 deletions
+30 -41
View File
@@ -1,57 +1,46 @@
export const SideBarItemHasSubMenu = [
"menu",
"financial",
"other",
"services",
"customers",
"representatives",
"users",
"content",
"reseller",
"dmenu",
"dkala",
"dpage",
"dmail",
"financial",
"support",
"other",
"products",
];
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",
services: "services",
customers: "customers",
representatives: "representatives",
reseller: "representatives",
users: "users",
ads: "content",
announcement: "content",
blog: "content",
learning: "content",
messages: "content",
reseller: "reseller",
dmenu: "dmenu",
dkala: "dkala",
dpage: "dpage",
dmail: "dmail",
sliders: "content",
payments: "financial",
receipts: "financial",
transactions: "financial",
discounts: "financial",
"card-bank": "financial",
support: "support",
tickets: "support",
feedback: "other",
"access-logs": "other",
criticisms: "other",
messages: "other",
dmenu: "products",
dkala: "products",
dpage: "products",
dmail: "products",
};
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";
return "customers";
}
const segment = pathname.split("/")[1] ?? "";