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