import React, {Component} from 'react' import {connect} from 'react-redux' import {rules, findRuleByDottedName} from '../engine/rules' import './Aide.css' import {EXPLAIN_VARIABLE} from '../actions' import References from './rule/References' import marked from '../engine/marked' @connect( state => ({explained: state.explainedVariable}), 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} = 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:

}
) } }