Added Frontend
This commit is contained in:
34
frontend/composables/useDashboard.ts
Normal file
34
frontend/composables/useDashboard.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
|
||||
const _useDashboard = () => {
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const isHelpSlideoverOpen = ref(false)
|
||||
const isNotificationsSlideoverOpen = ref(false)
|
||||
|
||||
defineShortcuts({
|
||||
'g-h': () => router.push('/'),
|
||||
'g-a': () => router.push('/standardEntity/tasks'),
|
||||
'g-d': () => router.push('/files'),
|
||||
'g-k': () => router.push('/standardEntity/customers'),
|
||||
'g-l': () => router.push('/standardEntity/vendors'),
|
||||
'g-s': () => router.push('/settings'),
|
||||
'g-p': () => router.push('/standardEntity/projects'),
|
||||
'g-v': () => router.push('/standardEntity/contracts'),
|
||||
'g-o': () => router.push('/standardEntity/plants'),
|
||||
'?': () => isHelpSlideoverOpen.value = !isHelpSlideoverOpen.value,
|
||||
n: () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value
|
||||
})
|
||||
|
||||
watch(() => route.fullPath, () => {
|
||||
isHelpSlideoverOpen.value = false
|
||||
isNotificationsSlideoverOpen.value = false
|
||||
})
|
||||
|
||||
return {
|
||||
isHelpSlideoverOpen,
|
||||
isNotificationsSlideoverOpen
|
||||
}
|
||||
}
|
||||
|
||||
export const useDashboard = createSharedComposable(_useDashboard)
|
||||
Reference in New Issue
Block a user