Move manager routes under /admin
This commit is contained in:
@@ -8,23 +8,20 @@ type DockItem = {
|
||||
const route = useRoute();
|
||||
|
||||
const dockItems: DockItem[] = [
|
||||
{ to: '/client-orders', label: 'Заказы', icon: 'orders' },
|
||||
{ to: '/bonus-system', label: 'Бонусы', icon: 'bonus' },
|
||||
{ to: '/messages', label: 'Настройки', icon: 'settings' },
|
||||
{ to: '/admin/orders', label: 'Заказы', icon: 'orders' },
|
||||
{ to: '/admin/bonuses/balances', label: 'Бонусы', icon: 'bonus' },
|
||||
{ to: '/admin/settings/messages', label: 'Настройки', icon: 'settings' },
|
||||
];
|
||||
|
||||
function isActive(path: string) {
|
||||
if (path === '/client-orders') {
|
||||
return route.path === '/client-orders'
|
||||
|| route.path.startsWith('/client-orders/')
|
||||
|| route.path === '/clients'
|
||||
|| route.path.startsWith('/clients/');
|
||||
if (path === '/admin/orders') {
|
||||
return route.path === '/admin/orders' || route.path.startsWith('/admin/orders/');
|
||||
}
|
||||
if (path === '/bonus-system') {
|
||||
return route.path === '/bonus-system' || route.path.startsWith('/bonus-system/');
|
||||
if (path === '/admin/bonuses/balances') {
|
||||
return route.path.startsWith('/admin/bonuses');
|
||||
}
|
||||
if (path === '/messages') {
|
||||
return route.path === '/messages';
|
||||
if (path === '/admin/settings/messages') {
|
||||
return route.path.startsWith('/admin/settings');
|
||||
}
|
||||
return route.path === path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user