Skip to content
Snippets Groups Projects
Commit e9ec7f2e authored by ems19's avatar ems19 Committed by Pietro Cavassin
Browse files

Insert Matomo Piwik in code

parent a4e6f329
Branches
No related tags found
2 merge requests!89Development,!87Insert Matomo Piwik in code
This diff is collapsed.
......@@ -20,6 +20,7 @@
"loaders.css": "^0.1.2",
"material-table": "^1.36.0",
"node-sass": "^4.13.1",
"piwik-react-router": "^0.12.1",
"react": "^16.12.0",
"react-apexcharts": "^1.3.7",
"react-base-table": "^1.9.2",
......@@ -43,10 +44,10 @@
"scripts": {
"startDev": "REACT_APP_STAGE=development react-scripts start",
"buildDev": "PUBLIC_URL=/mapfor REACT_APP_STAGE=development react-scripts build",
"startHom": "REACT_APP_STAGE=homologa react-scripts start",
"buildHom": "PUBLIC_URL=/mapfor REACT_APP_STAGE=homologa react-scripts build",
"startProd": "REACT_APP_STAGE=production react-scripts start",
"buildProd": "PUBLIC_URL=/mapfor REACT_APP_STAGE=production react-scripts build",
"startHom": "REACT_APP_STAGE=homologa REACT_APP_SITEID=16 react-scripts start",
"buildHom": "PUBLIC_URL=/mapfor REACT_APP_STAGE=homologa REACT_APP_SITEID=16 react-scripts build",
"startProd": "REACT_APP_STAGE=production REACT_APP_SITEID=14 react-scripts start",
"buildProd": "PUBLIC_URL=/mapfor REACT_APP_STAGE=production REACT_APP_SITEID=14 react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
......
......@@ -20,7 +20,7 @@ along with mapfor. If not, see <https://www.gnu.org/licenses/>.
import React, { useEffect }from 'react';
import { useDispatch } from 'react-redux';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import {BrowserRouter, Route, Switch } from 'react-router-dom';
import AccessibilityComponent from './components/Pages/AccessibilityComponent';
import HomePageComponent from './components/Pages/HomePageComponent';
......@@ -32,11 +32,18 @@ import PageComponent from './components/Pages/PageComponent';
import TeamComponent from './components/Pages/TeamComponent';
import FooterComponent from './components/FooterComponent';
import FaixaComponent from './components/FaixaComponent';
import createBrowserHistory from 'history/createBrowserHistory';
import { routes } from './data/routes';
import './App.scss';
function App() {
const dispatch = useDispatch();
const PiwikReactRouter = require('piwik-react-router');
const piwik = PiwikReactRouter({
url: '//piwik.c3sl.ufpr.br/',
siteId: process.env.REACT_APP_SITEID
});
const customHistory = createBrowserHistory();
useEffect(() => {
dispatch({ type: 'OFF_HIGH_CONTRAST' });
......@@ -44,7 +51,7 @@ function App() {
}, []);
return (
<Router>
<BrowserRouter history={piwik.connectToHistory(customHistory)}>
<div className="App">
<FaixaComponent />
<Switch>
......@@ -73,7 +80,7 @@ function App() {
</Switch>
<FooterComponent />
</div>
</Router>
</BrowserRouter>
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment