Ajout de la page base de règles
parent
b0be2bcdbe
commit
d740954833
|
@ -0,0 +1,4 @@
|
|||
#RulesList ul {
|
||||
margin: 0 auto;
|
||||
max-width: 860px;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import React, { Component } from "react"
|
||||
import { rules, encodeRuleName, nameLeaf } from "Engine/rules.js"
|
||||
import { Link } from "react-router-dom"
|
||||
import './RulesList.css'
|
||||
import {capitalise0} from '../utils'
|
||||
|
||||
export default class RulesList extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div id="RulesList">
|
||||
<h1>Notre base de règles</h1>
|
||||
<ul>
|
||||
{rules.map(rule => (
|
||||
<li key={rule.name}>
|
||||
<Link to={"/regle/" + encodeRuleName(rule.name)}>{capitalise0(rule.name)}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
|
@ -1,44 +1,45 @@
|
|||
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 ReactPiwik from 'react-piwik';
|
||||
import createHistory from 'history/createBrowserHistory'
|
||||
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"
|
||||
|
||||
const piwik = new ReactPiwik({
|
||||
url: 'stats.data.gouv.fr',
|
||||
siteId: 39,
|
||||
trackErrors: true,
|
||||
});
|
||||
url: "stats.data.gouv.fr",
|
||||
siteId: 39,
|
||||
trackErrors: true
|
||||
})
|
||||
|
||||
export default class Layout extends Component {
|
||||
history = createHistory();
|
||||
history = createHistory()
|
||||
|
||||
render() {
|
||||
let displayWarning = ['/simu/', '/regle/'].find(t => window.location.href.toString().indexOf(t) > -1)
|
||||
let displayWarning = ["/simu/", "/regle/", "/regles"].find(
|
||||
t => window.location.href.toString().indexOf(t) > -1
|
||||
)
|
||||
|
||||
// track the initial pageview
|
||||
ReactPiwik.push(['trackPageView'])
|
||||
ReactPiwik.push(["trackPageView"])
|
||||
|
||||
return (
|
||||
<Router history={piwik.connectToHistory(this.history)}>
|
||||
<div id="main">
|
||||
<div id="ninetyPercent">
|
||||
<div id="header">
|
||||
|
||||
{ displayWarning &&
|
||||
{displayWarning && (
|
||||
<div id="warning">
|
||||
<Link to="/contact">version BETA</Link>
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
{
|
||||
// this.props.location.pathname != '/' &&
|
||||
// <Link to="/">
|
||||
|
@ -47,10 +48,11 @@ export default class Layout extends Component {
|
|||
}
|
||||
</div>
|
||||
<Switch>
|
||||
<Route exact path="/" component={HomeEmbauche}/>
|
||||
<Route exact path="/syso" component={HomeSyso}/>
|
||||
<Route exact path="/" component={HomeEmbauche} />
|
||||
<Route exact path="/syso" component={HomeSyso} />
|
||||
<Route path="/contact" component={Contact} />
|
||||
<Route path="/regle/:name" component={Rule} />
|
||||
<Route path="/regles" component={RulesList} />
|
||||
<Route path="/simu/:name/:intro?" component={Simulateur} />
|
||||
<Route component={Route404} />
|
||||
</Switch>
|
||||
|
|
Loading…
Reference in New Issue