Skip to content
Snippets Groups Projects
MenuBar.js 5.48 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 { Link } from 'react-router-dom'
import { Container } from 'react-grid-system'
import logo from '../img/logo_small.svg'
smr17's avatar
smr17 committed
import '../App.css';
import Dropdown from './Dropdown';
import { Button } from '@material-ui/core';
import IconSearch from '@material-ui/icons/Search'
import ExitToAppIcon from '@material-ui/icons/ExitToApp'
import { Store } from '../Store';
import CloudUploadIcon from '@material-ui/icons/CloudUpload';
import Notifications from "./Notifications.js"
import MenuList from './MenuList'

const ContainerStyled = styled(Container)`
    *{ text-decoration: none }
    display: flex;
    align-items: center;
    border-top: 1px rgba(0,0,0,.1) solid;
    padding: 5px;
    *{
      margin-left: 10px;
    }
`
const ButtonStyled = styled(Button)`
    text-transform: capitalize !important;
`

const ButtonPublicarRecurso = styled(Button)`
    font-family : 'Roboto', sans serif;
    box-shadow : none !important;
    border : 1px transparent solid;
    background-color : #ff7f00 !important;
    align-content : center;
    text-transform: capitalize !important;
    font-stretch : expanded;
    max-width: 200 !important;
`

const IconSearchStyled = styled(IconSearch)`
  color: #16b8dd;
`
const ImageStyled = styled.img`
    height: 50px;
    width: auto;
    cursor: pointer;
    margin: 0 10px;
`

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;
`

const ButtonPubRecursoStyled = styled(Button)`
    border : 1.5px #666 solid !important;
    color: #666;
    box-shadow: none;
`


  const menuSobre = [
    { name: "Sobre a Plataforma", href: "" },
    { name: "Portais Parceiros", href: "" },
    { name: "Termos de Uso", href: "" },
    { name: "Contato", href: "" }
  ]
smr17's avatar
smr17 committed

  const menuAjuda = [
    { name: "Central de Ajuda", href: ""},
    { name: "Publicando Recursos", href: ""},
    { name: "Encontrando Recursos", href: ""},
    { name: "Participando da Rede", href: ""},
    { name: "Gerenciando a Conta", href: ""}
  ]
smr17's avatar
smr17 committed

      { name: "Perfil e Atividades", href: "/perfil"},
      { name: "Recursos Publicados", href: "/perfil/recursos-publicados"},
      { name: "Favoritos", href: "/perfil/favoritos"},
      { name: "Coleções", href: "/perfil/colecoes"},
      { name: "Rede", href: "/perfil/rede"},
      { name: "Configurações", href: "/perfil/cofiguracoes/editarperfil"},
  ]

      <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>
            </a>
            <ButtonStyled onClick={props.openSearchBar} ><IconSearchStyled />Buscar</ButtonStyled>
     </Left>
     <Right>
        {
            state.userIsLoggedIn
            ? (
                [
                    <>
                        <div style={{boxSizing:"border-box"}}>
                            <Link to="/termos-publicar-recurso">
                                <ButtonPublicarRecurso>
                                    <CloudUploadIcon style={{color:"white", marginLeft : "0"}}/>
                                        <span style={{color : "#fff", textAlign: "center", alignSelf : "center", fontWeight:"500"}} >
                                            PUBLICAR RECURSO
                                        </span>

                                </ButtonPublicarRecurso>
                            </Link>
                        </div>

                        <div>
                            <Notifications/>
                        </div>

                        <MenuList items={minhaArea}/>

                    </>
                ]
            )
            : (
                [
                    <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>