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/>.*/
Vinícius de Lima Gonçalves
committed
import React, { useContext, useEffect } from 'react';
import Home from './Pages/Home';
import Search from './Pages/Search'
import Header from './Components/Header'
import EcFooter from './Components/EcFooter';
import GNUAGPLfooter from './Components/AGPLFooter';
import UserPage from './Pages/UserPage';
import ResourcePage from './Pages/ResourcePage';
Vinícius de Lima Gonçalves
committed
import {BrowserRouter, Switch, Route} from 'react-router-dom';
import { Store } from './Store'

Lucas Eduardo Schoenfelder
committed
import TermsPage from './Pages/TermsPage.js'
import PublicationPermissionsPage from './Pages/PublicationPermissionsPage.js'
import Contact from './Pages/Contact.js'
Vinícius de Lima Gonçalves
committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
export default function App(){
// eslint-disable-next-line
const { state, dispatch } = useContext(Store)
useEffect(()=>{
dispatch({
type: 'WINDOW_SIZE',
innerWindow: {
width: window.innerWidth,
height: window.innerHeight
}
})
},[])
useEffect(()=>{
const setWindowSize = () => {
dispatch({
type: 'WINDOW_SIZE',
innerWindow: {
width: window.innerWidth,
height: window.innerHeight
}
})
}
window.addEventListener('resize',setWindowSize)
return () => window.removeEventListener('resize',setWindowSize)
},[window.innerWidth,window.innerHeight])
return(
<BrowserRouter>
<Header />
<div style={{backgroundImage: "linear-gradient(to right,#ff7f00,#e81f4f,#673ab7,#00bcd4)", height:"5px"}}></div>
<link href="https://fonts.googleapis.com/css?family=Kalam|Pompiere|Roboto&display=swap" rel="stylesheet"/>
Vinícius de Lima Gonçalves
committed
<Switch>
<Route path="/" exact={true} component={Home}/>
<Route path="/busca" component={Search} />

Lucas Eduardo Schoenfelder
committed
<Route path="/perfil-atualizacoes" component={UserPage} />
<Route path="/recurso" component={ResourcePage}/>

Lucas Eduardo Schoenfelder
committed
<Route path="/termos-publicar-recurso" component={TermsPage}/>
<Route path="/permission" component={PublicationPermissionsPage}/>
<Route path="/termos" component={UserTerms}/>
<Route path="/teste" component={Teste}/>
<Route path="/contato" component = {Contact}/>
Vinícius de Lima Gonçalves
committed
</Switch>
<EcFooter/>
<GNUAGPLfooter/>
</BrowserRouter>
)