export const dashboardState = {
    isOpened: true,
    classicSidebarMenuIsBeingHovered: false
}

export const bodyCanScroll = () => {
    return !dashboardState.isOpened || dashboardState.classicSidebarMenuIsBeingHovered
}

export const makeBodyUnscrollabble = () => {
    window.scrollTo(0, 0)
    document.body.style.overflow = 'hidden'
}

export const makeBodyscrollabble = () => {
    document.body.style.overflow = 'auto'
}

export const onClassicSidebarMenuIsBeingHovered = () => {
    dashboardState.classicSidebarMenuIsBeingHovered = true
    makeBodyscrollabble()
}

export const onClassicSidebarMenuIsBeingUnhovered = () => {
    dashboardState.classicSidebarMenuIsBeingHovered = true
    makeBodyUnscrollabble()
}