All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.core.templates.Sidebar.jsx Maven / Gradle / Ivy

The newest version!
import React from 'react'
import classNames from 'classnames'

import { SimpleSidebar } from '../../../plugins/SideBar/SidebarContainer'

/**
 * Обёртка над SimpleSidebar, отвечающая за скрытие/раскрытие по ховеру и перекрытием контента при overlay
 * TODO выглядит сложновато надо зарефачить
 */
export const Sidebar = ({ ...props }) => {
    const {
        controlled,
        overlay,
        toggleOnHover,
        openSideBar,
        closeSideBar,
        fullSizeHeader,
        sidebarOpen,
        className,
        fixed,
        defaultState,
        side,
    } = props

    const sidebarProps = {
        ...props,
        controlled,
        onMouseEnter: !overlay && toggleOnHover && openSideBar,
        onMouseLeave: !overlay && toggleOnHover && closeSideBar,
        className: classNames(
            className,
            {
                'n2o-fixed-sidebar': fixed && !fullSizeHeader,
            },
        ),
        sidebarOpen,
    }

    if (overlay) {
        return (
            
) } return ( ) } Sidebar.propTypes = SimpleSidebar.propTypes




© 2015 - 2024 Weber Informatics LLC | Privacy Policy