pingcrm/resources/js/Shared/MainMenu.vue

50 lines
1.8 KiB
Vue
Raw Normal View History

2019-03-18 08:53:00 -03:00
<template>
<div>
<div class="mb-4">
2021-12-08 14:52:56 -03:00
<Link class="group flex items-center py-3" href="/">
<icon name="dashboard" class="mr-2 w-4 h-4" :class="isUrl('') ? 'fill-white' : 'fill-indigo-400 group-hover:fill-white'" />
2019-05-22 12:39:26 -03:00
<div :class="isUrl('') ? 'text-white' : 'text-indigo-300 group-hover:text-white'">Dashboard</div>
2021-12-08 12:15:39 -03:00
</Link>
2019-03-18 08:53:00 -03:00
</div>
<div class="mb-4">
2021-12-08 14:52:56 -03:00
<Link class="group flex items-center py-3" href="/organizations">
<icon name="office" class="mr-2 w-4 h-4" :class="isUrl('organizations') ? 'fill-white' : 'fill-indigo-400 group-hover:fill-white'" />
2019-05-22 12:39:26 -03:00
<div :class="isUrl('organizations') ? 'text-white' : 'text-indigo-300 group-hover:text-white'">Organizations</div>
2021-12-08 12:15:39 -03:00
</Link>
2019-03-18 08:53:00 -03:00
</div>
<div class="mb-4">
2021-12-08 14:52:56 -03:00
<Link class="group flex items-center py-3" href="/contacts">
<icon name="users" class="mr-2 w-4 h-4" :class="isUrl('contacts') ? 'fill-white' : 'fill-indigo-400 group-hover:fill-white'" />
2019-05-22 12:39:26 -03:00
<div :class="isUrl('contacts') ? 'text-white' : 'text-indigo-300 group-hover:text-white'">Contacts</div>
2021-12-08 12:15:39 -03:00
</Link>
2019-03-18 08:53:00 -03:00
</div>
<div class="mb-4">
2021-12-08 14:52:56 -03:00
<Link class="group flex items-center py-3" href="/reports">
<icon name="printer" class="mr-2 w-4 h-4" :class="isUrl('reports') ? 'fill-white' : 'fill-indigo-400 group-hover:fill-white'" />
2019-05-22 12:39:26 -03:00
<div :class="isUrl('reports') ? 'text-white' : 'text-indigo-300 group-hover:text-white'">Reports</div>
2021-12-08 12:15:39 -03:00
</Link>
2019-03-18 08:53:00 -03:00
</div>
</div>
</template>
<script>
2021-12-08 12:15:39 -03:00
import { Link } from '@inertiajs/inertia-vue3'
2019-03-18 08:53:00 -03:00
import Icon from '@/Shared/Icon'
export default {
components: {
Icon,
2021-12-08 12:15:39 -03:00
Link,
2019-03-18 08:53:00 -03:00
},
methods: {
isUrl(...urls) {
let currentUrl = this.$page.url.substr(1)
2019-03-18 08:53:00 -03:00
if (urls[0] === '') {
return currentUrl === ''
2019-03-18 08:53:00 -03:00
}
2021-12-08 14:52:56 -03:00
return urls.filter((url) => currentUrl.startsWith(url)).length
2019-03-18 08:53:00 -03:00
},
},
}
</script>