import React, { useState } from 'react'; import { AppBar, Toolbar, IconButton, useScrollTrigger, Slide } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { Search, Clear } from '@material-ui/icons'; import SearchBar from './SearchBar'; interface PropTypes { menu: JSX.Element; logo: JSX.Element; } const useStyles = makeStyles({ root: { display: 'flex', justifyContent: 'space-between' } }); const MobileHeader: React.FC = React.memo(props => { const classes = useStyles(); const trigger = useScrollTrigger(); const [isSearchOpen, setIsSearchOpen] = useState(false); const { menu, logo } = props; const handleToggle = () => { setIsSearchOpen(value => !value); }; return ( {menu} {isSearchOpen ? : logo} {isSearchOpen ? : } ); }); export default MobileHeader;