import { Close20, Loop24, Menu20, Notification20, Settings20, Switcher20, UserAvatar20, } from "@carbon/icons-react"; import { Dropdown } from "antd"; import classNames from "classnames"; import React from "react"; import { Link } from "react-router-dom"; import SwitcherPanel from "../SwitcherPanel/SwitcherPanel"; import "./Header.scss"; import InputSearchHeader from "./InputSearchHeader/InputSearchHeader"; import Navbar from "./Navbar/Navbar"; import NotificationDropdown from "./Notification/NotificationDropdown"; import Profile from "./Profile/Profile"; const Header = () => { const user = JSON.parse(localStorage.getItem("currentUserInfo")); const [toggleNavbar, setToggleNavbar] = React.useState(true); const [show, setShow] = React.useState(false); const [active, setActive] = React.useState(false); const [activeProfile, setActiveProfile] = React.useState(false); const handleClickFocusNoti = React.useCallback(() => { setActive(!active); if (activeProfile) setActiveProfile(false); }, [active, activeProfile]); const handleClickFocusProfile = React.useCallback(() => { setActiveProfile(!activeProfile); if (active) setActive(false); }, [active, activeProfile]); const handleShowRightBar = React.useCallback(() => { setShow(true); if (activeProfile) setActiveProfile(false); if (active) setActive(false); }, [active, activeProfile]); const handleCloseRightBar = React.useCallback(() => { setShow(false); }, []); return (
Logo
} trigger={["click"]} placement="bottom" open={active} > ( )} trigger={["click"]} placement="bottom" open={activeProfile} > ( )} trigger={["click"]} placement="bottom" open={show} > {!show ? ( ) : ( )}
); }; export default Header;