fix kashkool

This commit is contained in:
2026-06-29 22:43:28 +03:30
parent be17631109
commit 8b855e5ee4
150 changed files with 11974 additions and 4445 deletions
+26
View File
@@ -0,0 +1,26 @@
import { useMediaQuery } from '@vueuse/core'
import { onUnmounted, watch } from 'vue'
import { DESKTOP_LAYOUT_MIN_WIDTH } from '../constants'
const DESKTOP_LAYOUT_CLASS = 'app-layout--desktop'
export function useDesktopBreakpoint() {
return useMediaQuery(`(min-width: ${DESKTOP_LAYOUT_MIN_WIDTH}px)`)
}
export function useApplyDesktopLayoutClass() {
const isDesktopLayout = useDesktopBreakpoint()
const stop = watch(
isDesktopLayout,
(desktop) => {
document.documentElement.classList.toggle(DESKTOP_LAYOUT_CLASS, desktop)
},
{ immediate: true }
)
onUnmounted(() => {
stop()
document.documentElement.classList.remove(DESKTOP_LAYOUT_CLASS)
})
}
@@ -0,0 +1,43 @@
import { computed, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
export function useAppNavigation() {
const router = useRouter()
const route = useRoute()
const popVisible = ref(false)
const currentRoute = computed(() => route.name)
const hideMenu = computed(() => !!route.meta.hideMenu)
function isNavActive(routeName: string) {
return currentRoute.value === routeName
}
function navItemClass(routeName: string) {
return isNavActive(routeName) ? 'text-primary' : 'text-gray-400'
}
function navigateTo(routeName: string) {
popVisible.value = false
router.push({ name: routeName })
}
function toggleOverflowMenu() {
popVisible.value = !popVisible.value
}
function closeOverflowMenu() {
popVisible.value = false
}
return {
popVisible,
currentRoute,
hideMenu,
isNavActive,
navItemClass,
navigateTo,
toggleOverflowMenu,
closeOverflowMenu,
}
}
@@ -0,0 +1 @@
export { useDesktopBreakpoint, useApplyDesktopLayoutClass } from './useAppLayout'