import React, { Component } from 'react' import { connect } from 'react-redux' import marked from 'Engine/marked' import { rules, findRuleByDottedName } from 'Engine/rules' import { EXPLAIN_VARIABLE } from '../actions' import References from './rule/References' import './Aide.css' @connect( state => ({ explained: state.explainedVariable, themeColours: state.themeColours }), dispatch => ({ stopExplaining: () => dispatch({ type: EXPLAIN_VARIABLE }) }) ) export default class Aide extends Component { renderExplanationMarkdown(explanation, term) { return marked(`### ${term} \n\n${explanation}`) } render() { let { explained, stopExplaining, themeColours } = this.props if (!explained) return
let rule = findRuleByDottedName(rules, explained), text = rule.description, refs = rule.références let possibilities = rule['choix exclusifs'] return (

{/* { possibilities &&

{possibilities.length} possibilités :

    {possibilities.map(p =>
  • {p}
  • )}

} */} {refs && (

Pour en savoir plus:

)}
) } }