/*Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre Departamento de Informatica - Universidade Federal do Parana This file is part of Plataforma Integrada MEC. Plataforma Integrada MEC is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Plataforma Integrada MEC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ import React from 'react' import MenuIcon from '@material-ui/icons/Menu'; import styled from 'styled-components' import { Button } from '@material-ui/core' import logo from '../img/logo_small.svg' import { Link } from 'react-router-dom' import MobileDrawerMenu from './MobileDrawerMenu'; import IconSearch from '@material-ui/icons/Search' export default function MenuBarMobile(props) { const [drawerOpen, setDrawerStatus] = React.useState(false); const toggleDrawer = (open) => (event) => { if (event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) { return; } setDrawerStatus(open); }; return ( <> <MobileDrawerMenu contrast={props.contrast} anchor={'left'} open={drawerOpen} onClose={toggleDrawer(false)} openSignUp={props.openSignUp} openLogin={props.openLogin} /> <OuterDiv contrast={props.contrast}> <Button style={props.contrast === "" ? { color: "#00bcd4" } : { color: "white " }} onClick={toggleDrawer(true)}> <MenuIcon className="icon" /> </Button> <DrawerButtonDiv> <Link to={"/"}> <img src={logo} alt="logo" style={{ border: "0", verticalAlign: "middle" }} /> </Link> </DrawerButtonDiv> <Button style={{ position: "absolute", right: 0 }} onClick={props.openSearchBar}> <IconSearchStyled style={props.contrast === "" ? { color: "#00bcd4" } : { color: "white " }} /> </Button> </OuterDiv> </> ) } const OuterDiv = styled.div` height : 48px; width : 100%; background: ${props => props.contrast === "" ? "" : "black"}; display : flex; direction : row; align-items : center; img { height : 38px; overflow : hidden; } ` const DrawerButtonDiv = styled.div` height : 38px; width : 45.55px; position:absolute; left:0; right:0; margin-left:auto; margin-right:auto; ` const IconSearchStyled = styled(IconSearch)` color: #16b8dd; height : 38px; width : 45.55px; margin-left:auto; margin-right:auto; `