Skip to content
Snippets Groups Projects
MenuBarMobile.js 3.12 KiB
Newer Older
/*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'
lfr20's avatar
lfr20 committed
import { Button } from '@material-ui/core'
import logo from '../img/logo_small.svg'
lfr20's avatar
lfr20 committed
import { Link } from 'react-router-dom'
import MobileDrawerMenu from './MobileDrawerMenu';
import IconSearch from '@material-ui/icons/Search'
lfr20's avatar
lfr20 committed
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 (
lfr20's avatar
lfr20 committed
        <>
lfr20's avatar
lfr20 committed
            <MobileDrawerMenu
                contrast={props.contrast}
                anchor={'left'}
                open={drawerOpen}
lfr20's avatar
lfr20 committed
                openSignUp={props.openSignUp} openLogin={props.openLogin}
            />
lfr20's avatar
lfr20 committed
            <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" }} />
lfr20's avatar
lfr20 committed
                    </Link>
                </DrawerButtonDiv>
lfr20's avatar
lfr20 committed
                <Button style={{ position: "absolute", right: 0 }} onClick={props.openSearchBar}>
                    <IconSearchStyled style={props.contrast === "" ? { color: "#00bcd4" } : { color: "white " }} />
                </Button>
lfr20's avatar
lfr20 committed
            </OuterDiv>
        </>
lfr20's avatar
lfr20 committed
const OuterDiv = styled.div`
lfr20's avatar
lfr20 committed
    width : 100%;
lfr20's avatar
lfr20 committed
    background: ${props => props.contrast === "" ? "" : "black"};
    display : flex;
    direction : row;
lfr20's avatar
lfr20 committed
    align-items : center;
lfr20's avatar
lfr20 committed

lfr20's avatar
lfr20 committed
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;
`