56 lines
1.6 KiB
Vue
56 lines
1.6 KiB
Vue
<template>
|
|||
|
|
<aside
|
||
|
|
class="desktop-sidebar"
|
||
|
|
:class="{ 'desktop-sidebar--boursecu': isBoursecu }"
|
||
|
|
>
|
||
|
|
<div class="desktop-sidebar__brand">
|
||
|
|
<img
|
||
|
|
:src="navLogo"
|
||
|
|
alt=""
|
||
|
|
class="desktop-sidebar__logo"
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<nav class="desktop-sidebar__section" aria-label="منوی اصلی">
|
||
|
|
<DesktopNavItem
|
||
|
|
v-for="item in primaryItems"
|
||
|
|
:key="item.id"
|
||
|
|
:icon="item.icon"
|
||
|
|
:label="item.label"
|
||
|
|
:active="isNavActive(item.routeName)"
|
||
|
|
@click="navigateTo(item.routeName)"
|
||
|
|
/>
|
||
|
|
</nav>
|
||
|
|
|
||
|
|
<div class="desktop-sidebar__divider" />
|
||
|
|
|
||
|
|
<nav class="desktop-sidebar__section desktop-sidebar__section--secondary" aria-label="منوی فرعی">
|
||
|
|
<DesktopNavItem
|
||
|
|
v-for="item in secondaryItems"
|
||
|
|
:key="item.id"
|
||
|
|
:icon="item.icon"
|
||
|
|
:label="item.label"
|
||
|
|
:active="isNavActive(item.routeName)"
|
||
|
|
@click="navigateTo(item.routeName)"
|
||
|
|
/>
|
||
|
|
</nav>
|
||
|
|
</aside>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script lang="ts" setup>
|
||
|
|
import { computed } from 'vue'
|
||
|
|
import { useConfigStore } from '@/store/configStore'
|
||
|
|
import { getProjectNavLogo, isBoursecuProject } from '@/utils/config'
|
||
|
|
import { getPrimaryNavItems, SECONDARY_NAV } from '../config/navigation'
|
||
|
|
import { useAppNavigation } from '../composables/useAppNavigation'
|
||
|
|
import DesktopNavItem from './DesktopNavItem.vue'
|
||
|
|
|
||
|
|
const config = useConfigStore()
|
||
|
|
const isBoursecu = isBoursecuProject()
|
||
|
|
const navLogo = computed(() => getProjectNavLogo(config.config?.avatar))
|
||
|
|
const primaryItems = getPrimaryNavItems()
|
||
|
|
const secondaryItems = SECONDARY_NAV
|
||
|
|
|
||
|
|
const { isNavActive, navigateTo } = useAppNavigation()
|
||
|
|
</script>
|