import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import React from "react";
import enhanceWithClickOutside from "react-click-outside";
import { List } from "../list";
import MobileMenu from "../mobile-menu";
import ScreenView from "../../../screen-view";
import { Wrapper, BurgerWrapper, Line } from "./styled";
class Burger extends React.Component {
    state = {
        opened: false,
    };
    handleClickOutside() {
        this.setState({ opened: false });
    }
    /*
    private toggleScroll(opened: boolean) {
      if (!opened) {
        document.body.style.overflowY = "unset";
      } else {
        document.body.style.overflowY = "hidden";
      }
    }
    */
    render() {
        const { props: { burgerLinks, mobileLinks, mobileSidebar, eqLab }, state: { opened }, } = this;
        const isGenshiro = process.env.REACT_APP_THEME === "Genshiro";
        return (_jsxs(_Fragment, { children: [_jsx(ScreenView.Large, { children: !isGenshiro ? (_jsxs(Wrapper, { className: `ui-header__burger-wrapper ${eqLab ? "ui-header__burger--eqlab" : ""}`, children: [_jsx(BurgerWrapper, { opened: opened, onClick: () => {
                                    this.setState({ opened: !opened });
                                    /*
                                      if (this.props.fixBody) {
                                        this.toggleScroll(!opened);
                                      }
                                      */
                                }, className: "ui-header__burger-button", children: _jsx(Line, {}) }), opened && (_jsx(List, { className: "ui-header__burger-list", onClick: () => {
                                    this.setState({ opened: false });
                                    /*
                                      if (this.props.fixBody) {
                                        this.toggleScroll(false);
                                      }
                                      */
                                }, children: burgerLinks }))] })) : null }), _jsx(ScreenView.NotLarge, { children: _jsxs(Wrapper, { className: `ui-header__burger-wrapper ${eqLab ? "ui-header__burger--eqlab" : ""}`, children: [_jsx(BurgerWrapper, { opened: opened, onClick: () => {
                                    this.setState({ opened: !opened });
                                }, className: "ui-header__burger-button", children: _jsx(Line, {}) }), opened && (_jsx(MobileMenu, { sidebar: mobileSidebar, children: mobileLinks }))] }) })] }));
    }
}
export default enhanceWithClickOutside(Burger);
//# sourceMappingURL=index.js.map