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/>.*/

Lucas Eduardo Schoenfelder
committed
import React, {useContext} from 'react';
Vinícius de Lima Gonçalves
committed
import { Link } from 'react-router-dom'
import { Container } from 'react-grid-system'
import logo from '../img/logo_small.svg'
Vinícius de Lima Gonçalves
committed
import Dropdown from './Dropdown';
import { Button } from '@material-ui/core';
import IconSearch from '@material-ui/icons/Search'

Lucas Eduardo Schoenfelder
committed
import ExitToAppIcon from '@material-ui/icons/ExitToApp'
Vinícius de Lima Gonçalves
committed
import styled from 'styled-components'

Lucas Eduardo Schoenfelder
committed
import { Store } from '../Store';
import CloudUploadIcon from '@material-ui/icons/CloudUpload';
import Notifications from "./Notifications.js"
Vinícius de Lima Gonçalves
committed
const ContainerStyled = styled(Container)`
*{ text-decoration: none }
display: flex;
align-items: center;
border-top: 1px rgba(0,0,0,.1) solid;
padding: 5px;

Lucas Eduardo Schoenfelder
committed
padding-top : 10px;
Vinícius de Lima Gonçalves
committed
`
Vinícius de Lima Gonçalves
committed
text-transform: capitalize !important;
margin : 0 8px !important;
font-weight : normal !important;
Vinícius de Lima Gonçalves
committed
`

Lucas Eduardo Schoenfelder
committed
const ButtonPublicarRecurso = styled(Button)`
font-family : 'Roboto', sans serif;
box-shadow : none !important;
border : 1px transparent solid;
background-color : #ff7f00 !important;
align-content : center;

Lucas Eduardo Schoenfelder
committed
font-weight : 500 !important;

Lucas Eduardo Schoenfelder
committed
text-transform: capitalize !important;
font-stretch : expanded;
max-width: 200 !important;
.MuiSvgIcon-root {
vertical-align : middle !important;
margin-right : 5px !important;
}

Lucas Eduardo Schoenfelder
committed
`
Vinícius de Lima Gonçalves
committed
const IconSearchStyled = styled(IconSearch)`
color: #16b8dd;
`
const ImageStyled = styled.img`
height: 50px;
width: auto;
cursor: pointer;
margin: 0 10px;
`

Lucas Eduardo Schoenfelder
committed
const Right = styled.span`
width: 100%;
display: inline-flex;
align-items: center;
justify-content: flex-end;
margin-right : 10px;
`
const Left = styled.span `
width: 100%;
display: inline-flex;
align-items: center;
`
export const ButtonPubRecursoStyled = styled(Button)`

Lucas Eduardo Schoenfelder
committed
font-weight : 500 !important;

Lucas Eduardo Schoenfelder
committed
border : 1.5px #666 solid !important;
color: #666;
box-shadow: none;
margin : 0 8px !important;
font-weight : normal !important;

Lucas Eduardo Schoenfelder
committed
`
Vinícius de Lima Gonçalves
committed
export default function MenuBar(props){

Lucas Eduardo Schoenfelder
committed
const { state, dispatch } = useContext(Store)
Vinícius de Lima Gonçalves
committed
const menuSobre = [
{ name: "Portais Parceiros", href: "sobre#portaisparceiros" },
{ name: "Termos de Uso", href: "termos" },
{ name: "Contato", href: "contato" }
Vinícius de Lima Gonçalves
committed
]
Vinícius de Lima Gonçalves
committed
const menuAjuda = [
{ name: "Publicando Recursos", href: "publicando-recurso"},
{ name: "Encontrando Recursos", href: "encontrando-recurso"},
{ name: "Participando da Rede", href: "participando-da-rede"},
{ name: "Gerenciando a Conta", href: "gerenciando-conta"}
Vinícius de Lima Gonçalves
committed
]

Lucas Eduardo Schoenfelder
committed
const minhaArea = [
{ name: "Perfil e Atividades", href: "/perfil", value : '0'},
{ name: "Recursos Publicados", href: "/perfil", value : '1'},
{ name: "Favoritos", href: "/perfil", value : '2'},
{ name: "Coleções", href: "/perfil", value : '3'},
{ name: "Rede", href: "/perfil", value : '4'},
{ name: "Configurações", href: "/editarperfil"},

Lucas Eduardo Schoenfelder
committed
]
Vinícius de Lima Gonçalves
committed
return(
<ContainerStyled fluid={true} >

Lucas Eduardo Schoenfelder
committed
<Left>
<Link to="/"> <ImageStyled src={logo} alt="Plataforma Integrada" /> </Link>
<Dropdown name="Sobre" items={menuSobre}/>
<Dropdown name="Ajuda" items={menuAjuda}/>
<a href="http://educacaoconectada.mec.gov.br/" rel="noopener noreferrer" target="_blank" >
<ButtonStyled >Educação Conectada</ButtonStyled>
</Link>*/}
<ButtonStyled onClick={props.openSearchBar} ><IconSearchStyled />Buscar</ButtonStyled>

Lucas Eduardo Schoenfelder
committed
</Left>
<Right>
{
state.userIsLoggedIn
? (
<>
<div style={{boxSizing:"border-box"}}>
<Link to="/termos-publicar-recurso" cameFromPublishButton={true}>

Lucas Eduardo Schoenfelder
committed
<ButtonPublicarRecurso>
<CloudUploadIcon style={{color:"white", marginLeft : "0"}}/>
<span style={{color : "#fff", textAlign: "center", alignSelf : "center", fontWeight:"500"}} >

Lucas Eduardo Schoenfelder
committed
PUBLICAR RECURSO
</span>
</ButtonPublicarRecurso>
</Link>
</div>
<div>
<Notifications/>
</div>

Lucas Eduardo Schoenfelder
committed
</>
)
: (
<React.Fragment>
<ButtonPubRecursoStyled onClick={props.openLogin}>PUBLICAR RECURSO?</ButtonPubRecursoStyled>
<ButtonStyled onClick={props.openLogin}><ExitToAppIcon style={{color:"#00bcd4"}}/>Entrar</ButtonStyled>
<ButtonStyled onClick={props.openSignUp}>Cadastre-se</ButtonStyled>
</React.Fragment>
)
}
</Right>
Vinícius de Lima Gonçalves
committed
</ContainerStyled>
);