Move manager navigation to bottom dock

This commit is contained in:
Ruslan Bakiev
2026-04-06 10:53:15 +07:00
parent 453092c289
commit 714d0cc9b7
4 changed files with 145 additions and 23 deletions

View File

@@ -1,8 +1,4 @@
<script setup lang="ts">
import { useQuery } from '@vue/apollo-composable';
import { MeDocument } from '~/composables/graphql/generated';
import { hasManagerAccess } from '~/utils/roles';
type NavItem = {
to: string;
label: string;
@@ -10,24 +6,10 @@ type NavItem = {
const route = useRoute();
const { totalItems } = useClientCart();
const meQuery = useQuery(MeDocument);
const centerCapsule = computed<NavItem[]>(() => {
const items: NavItem[] = [
{ to: '/', label: 'Каталог' },
{ to: '/orders', label: 'Мои заказы' },
];
if (hasManagerAccess(meQuery.result.value?.me?.role)) {
items.push(
{ to: '/clients', label: 'Пользователи' },
{ to: '/client-orders', label: 'Заказы' },
{ to: '/bonus-system', label: 'Бонусы' },
);
}
return items;
});
const centerCapsule: NavItem[] = [
{ to: '/', label: 'Каталог' },
{ to: '/orders', label: 'Мои заказы' },
];
const rightCapsule: NavItem[] = [
{ to: '/cart', label: 'Корзина' },