2017-10-13 16:32:18 +00:00
|
|
|
import React, { Component } from "react"
|
|
|
|
import "./Layout.css"
|
|
|
|
import "./reset.css"
|
|
|
|
import { Link, Route, Router, Switch } from "react-router-dom"
|
|
|
|
import HomeEmbauche from "Components/HomeEmbauche"
|
|
|
|
import HomeSyso from "Components/HomeSyso"
|
|
|
|
import Rule from "Components/rule/Rule"
|
|
|
|
import Route404 from "Components/Route404"
|
|
|
|
import Contact from "Components/Contact"
|
|
|
|
import Simulateur from "Components/Simulateur"
|
|
|
|
import Results from "Components/Results"
|
|
|
|
import RulesList from "Components/RulesList"
|
|
|
|
import ReactPiwik from "react-piwik"
|
|
|
|
import createHistory from "history/createBrowserHistory"
|
2017-10-12 14:08:43 +00:00
|
|
|
|
|
|
|
const piwik = new ReactPiwik({
|
2017-10-13 16:32:18 +00:00
|
|
|
url: "stats.data.gouv.fr",
|
|
|
|
siteId: 39,
|
|
|
|
trackErrors: true
|
|
|
|
})
|
2016-11-15 18:46:17 +00:00
|
|
|
|
|
|
|
export default class Layout extends Component {
|
2017-10-13 16:32:18 +00:00
|
|
|
history = createHistory()
|
2017-10-12 14:41:00 +00:00
|
|
|
|
2016-11-15 18:46:17 +00:00
|
|
|
render() {
|
2017-10-13 16:32:18 +00:00
|
|
|
let displayWarning = ["/simu/", "/regle/", "/regles"].find(
|
|
|
|
t => window.location.href.toString().indexOf(t) > -1
|
|
|
|
)
|
2017-05-04 10:12:26 +00:00
|
|
|
|
2017-10-12 14:08:43 +00:00
|
|
|
// track the initial pageview
|
2017-10-13 16:32:18 +00:00
|
|
|
ReactPiwik.push(["trackPageView"])
|
2017-10-12 14:08:43 +00:00
|
|
|
|
2017-04-18 17:37:38 +00:00
|
|
|
return (
|
2017-10-12 14:41:00 +00:00
|
|
|
<Router history={piwik.connectToHistory(this.history)}>
|
2017-04-18 17:37:38 +00:00
|
|
|
<div id="main">
|
|
|
|
<div id="ninetyPercent">
|
|
|
|
<div id="header">
|
2017-10-13 16:32:18 +00:00
|
|
|
{displayWarning && (
|
2017-05-04 10:12:26 +00:00
|
|
|
<div id="warning">
|
|
|
|
<Link to="/contact">version BETA</Link>
|
|
|
|
</div>
|
2017-10-13 16:32:18 +00:00
|
|
|
)}
|
2017-04-18 17:37:38 +00:00
|
|
|
{
|
|
|
|
// this.props.location.pathname != '/' &&
|
|
|
|
// <Link to="/">
|
|
|
|
// <img id="site-logo" src={require('../images/logo.png')} />
|
|
|
|
// </Link>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
<Switch>
|
2017-10-13 16:32:18 +00:00
|
|
|
<Route exact path="/" component={HomeEmbauche} />
|
|
|
|
<Route exact path="/syso" component={HomeSyso} />
|
2017-04-18 17:37:38 +00:00
|
|
|
<Route path="/contact" component={Contact} />
|
|
|
|
<Route path="/regle/:name" component={Rule} />
|
2017-10-13 16:32:18 +00:00
|
|
|
<Route path="/regles" component={RulesList} />
|
2017-05-07 17:45:44 +00:00
|
|
|
<Route path="/simu/:name/:intro?" component={Simulateur} />
|
2017-04-18 17:37:38 +00:00
|
|
|
<Route component={Route404} />
|
|
|
|
</Switch>
|
|
|
|
</div>
|
|
|
|
<Results />
|
2017-01-26 16:16:15 +00:00
|
|
|
</div>
|
2017-04-18 17:37:38 +00:00
|
|
|
</Router>
|
2016-11-15 18:46:17 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|