import React, { useState } from 'react'; import Search from '../Search'; import { getRegistryURL } from '../../utils/url'; import Button from '../../muiComponents/Button'; import { NavBar, InnerNavBar, MobileNavBar, InnerMobileNavBar } from './styles'; import HeaderLeft from './HeaderLeft'; import HeaderRight from './HeaderRight'; import HeaderInfoDialog from './HeaderInfoDialog'; interface Props { logo?: string; username?: string; onLogout: () => void; onToggleLoginModal: () => void; scope: string; withoutSearch?: boolean; } /* eslint-disable react/jsx-max-depth */ /* eslint-disable react/jsx-no-bind*/ const Header: React.FC = ({ logo, withoutSearch, username, onLogout, onToggleLoginModal, scope }) => { const [isInfoDialogOpen, setOpenInfoDialog] = useState(); const [showMobileNavBar, setShowMobileNavBar] = useState(); return ( <> setOpenInfoDialog(true)} onToggleLogin={onToggleLoginModal} onToggleMobileNav={() => setShowMobileNavBar(!showMobileNavBar)} username={username} withoutSearch={withoutSearch} /> setOpenInfoDialog(false)} registryUrl={getRegistryURL()} scope={scope} /> {showMobileNavBar && !withoutSearch && ( )} ); }; export default Header;