import React, {Component} from 'react' import './CDD.css' import Results from './Results' import {reduxForm, formValueSelector} from 'redux-form' import {connect} from 'react-redux' import './conversation/conversation.css' import {START_CONVERSATION} from '../actions' import Aide from './Aide' import PageTypeIcon from './PageTypeIcon' //TODO fusionner SimulationCDD & SimulationNet let situationSelector = formValueSelector('conversation') @reduxForm({form: 'conversation', destroyOnUnmount: false}) @connect( state => ({ situation: variableName => situationSelector(state, variableName), foldedSteps: state.foldedSteps, unfoldedSteps: state.unfoldedSteps, themeColours: state.themeColours, analysedSituation: state.analysedSituation, }), dispatch => ({ startConversation: rootVariable => dispatch({type: START_CONVERSATION, rootVariable}), }), ) export default class SimulationNet extends Component { componentDidMount() { // C'est ici que la génération du formulaire, et donc la traversée des variables commence this.props.startConversation('salaire net') } render() { let {foldedSteps, unfoldedSteps, situation} = this.props return (

Simulateur salaire net

{foldedSteps .map(step => ( ))}
{unfoldedSteps.map(step => ( ))}
{unfoldedSteps.length == 0 &&

Nous n'avons plus de questions : votre simulation est terminée.

Une remarque ?   Écrivez-nous {' '} {' '} !

}
) } }