Move manager navigation to bottom dock
This commit is contained in:
@@ -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: 'Корзина' },
|
||||
|
||||
Reference in New Issue
Block a user