2017-03-09 18:21:24 +01:00
|
|
|
import React, {Component} from 'react'
|
2016-11-15 19:46:17 +01:00
|
|
|
import './Home.css'
|
2017-01-20 11:52:39 +01:00
|
|
|
import {searchRules} from '../engine/rules.js'
|
2016-12-07 19:08:10 +01:00
|
|
|
import {Link} from 'react-router'
|
2017-02-13 13:28:49 +01:00
|
|
|
import '../components/Rule.css'
|
2017-03-17 12:37:55 +01:00
|
|
|
import R from 'ramda'
|
2016-11-15 19:46:17 +01:00
|
|
|
|
|
|
|
export default class Home extends Component {
|
2016-11-16 11:15:33 +01:00
|
|
|
state = {
|
2017-03-09 18:21:24 +01:00
|
|
|
userSearch: '',
|
|
|
|
};
|
2016-11-15 19:46:17 +01:00
|
|
|
render() {
|
|
|
|
return (
|
2017-03-09 18:21:24 +01:00
|
|
|
<div id="home">
|
|
|
|
<section id="brand">
|
|
|
|
<img src={require('../images/logo.png')} />
|
|
|
|
<span id="name">
|
|
|
|
Système <br />
|
|
|
|
Social
|
|
|
|
</span>
|
|
|
|
<span id="version">alpha</span>
|
|
|
|
</section>
|
|
|
|
<section id="description">
|
|
|
|
<p>
|
|
|
|
Les règles des taxes et cotisations sur le travail{' '}
|
|
|
|
<span className="insist">lisibles</span>
|
|
|
|
{' '}par un humain et{' '}
|
|
|
|
<span className="insist">interprétables</span>
|
|
|
|
{' '}par un programme.{' '}
|
|
|
|
<Link id="aboutLink" to="/a-propos">En savoir plus</Link>
|
|
|
|
</p>
|
|
|
|
</section>
|
|
|
|
<section id="roads">
|
|
|
|
|
|
|
|
<section id="exploration">
|
|
|
|
<h1><i className="fa fa-search" aria-hidden="true"></i>Explorez la base</h1>
|
|
|
|
<input
|
2017-03-14 15:54:09 +01:00
|
|
|
placeholder="Cherchez par ex. chomage"
|
2017-03-09 18:21:24 +01:00
|
|
|
onChange={e => this.setState({userSearch: e.target.value})}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<section id="search-results">
|
|
|
|
<ul>
|
|
|
|
{this.state.userSearch != null &&
|
2017-03-17 12:37:55 +01:00
|
|
|
searchRules(this.state.userSearch).map(({type, name}) => R.contains(type, ['Indemnité', 'Cotisation']) && (
|
2017-03-09 18:21:24 +01:00
|
|
|
<li key={name}>
|
|
|
|
<span className="rule-type">
|
|
|
|
{type}
|
|
|
|
</span>
|
|
|
|
<span className="rule-name">
|
|
|
|
<Link to={`/regle/${name}`}>{name}</Link>
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section id="simulation">
|
|
|
|
<h1><i className="fa fa-calculator" aria-hidden="true"></i>Simulez vos droits et obligations</h1>
|
|
|
|
<ul>
|
|
|
|
<li key="cdd">
|
|
|
|
<span className="simulateur">Surcoût du CDD</span>
|
2017-03-09 19:10:28 +01:00
|
|
|
<Link to="/cdd-intro"><button>Essayer</button></Link>
|
2017-03-09 18:21:24 +01:00
|
|
|
</li>
|
|
|
|
<li key="embauche">
|
|
|
|
<span className="simulateur">Prix global de l'embauche</span>
|
|
|
|
<Link><button className="disabled">Bientôt disponible</button></Link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
)
|
2016-11-15 19:46:17 +01:00
|
|
|
}
|
|
|
|
}
|