2017-12-05 11:58:24 +00:00
|
|
|
import React, { Component } from "react"
|
|
|
|
import "./Layout.css"
|
|
|
|
import "./reset.css"
|
|
|
|
import "./ribbon.css"
|
2017-10-13 14:15:07 +00:00
|
|
|
|
2017-12-05 11:58:24 +00:00
|
|
|
import { Link, Route, Router, Switch, Redirect } from "react-router-dom"
|
2017-10-13 14:15:07 +00:00
|
|
|
|
2017-12-05 11:58:24 +00:00
|
|
|
import Home from "Components/Home"
|
2017-12-07 14:19:51 +00:00
|
|
|
import RulePage from "Components/RulePage"
|
2017-12-05 11:58:24 +00:00
|
|
|
import Route404 from "Components/Route404"
|
|
|
|
import Contact from "Components/Contact"
|
|
|
|
import Simulateur from "Components/Simulateur"
|
|
|
|
import RulesList from "Components/RulesList"
|
2017-10-12 14:08:43 +00:00
|
|
|
|
2017-12-05 11:58:24 +00:00
|
|
|
import ReactPiwik from "Components/Tracker"
|
|
|
|
import createHistory from "history/createBrowserHistory"
|
2017-10-16 17:08:08 +00:00
|
|
|
|
2017-10-12 14:08:43 +00:00
|
|
|
const piwik = new ReactPiwik({
|
2017-12-05 11:58:24 +00:00
|
|
|
url: "stats.data.gouv.fr",
|
|
|
|
siteId: 39,
|
|
|
|
trackErrors: true
|
2017-10-13 16:32:18 +00:00
|
|
|
})
|
2016-11-15 18:46:17 +00:00
|
|
|
|
|
|
|
export default class Layout extends Component {
|
2017-12-05 11:58:24 +00:00
|
|
|
history = createHistory()
|
|
|
|
render() {
|
|
|
|
// track the initial pageview
|
|
|
|
ReactPiwik.push(["trackPageView"])
|
2017-05-04 10:12:26 +00:00
|
|
|
|
2017-12-05 11:58:24 +00:00
|
|
|
return (
|
|
|
|
<Router history={piwik.connectToHistory(this.history)}>
|
|
|
|
<Switch>
|
|
|
|
<Route exact path="/" component={Home} />
|
|
|
|
<Route path="/contact" component={Contact} />
|
2017-12-07 14:19:51 +00:00
|
|
|
<Route path="/regle/:name" component={RulePage} />
|
2017-12-05 11:58:24 +00:00
|
|
|
<Route path="/regles" component={RulesList} />
|
|
|
|
<Route path="/simu/:targets" component={Simulateur} />
|
|
|
|
<Redirect from="/simu/" to="/" />
|
|
|
|
<Redirect from="/simu/:name/intro" to="/simu/:name" />
|
|
|
|
<Route component={Route404} />
|
|
|
|
</Switch>
|
|
|
|
</Router>
|
|
|
|
)
|
|
|
|
}
|
2016-11-15 18:46:17 +00:00
|
|
|
}
|