import Answers from 'Components/AnswerList' import Conversation from 'Components/conversation/Conversation' import { ScrollToElement } from 'Components/utils/Scroll' import withColours from 'Components/utils/withColours' import { compose, isEmpty } from 'ramda' import { React, T } from 'Components' import { connect } from 'react-redux' import { nextStepsSelector, noUserInputSelector, blockingInputControlsSelector, validInputEnteredSelector } from 'Selectors/analyseSelectors' import Animate from 'Ui/animate' import PageFeedback from 'Components/Feedback/PageFeedback' export default compose( withColours, connect(state => ({ conversationStarted: state.conversationStarted, previousAnswers: state.conversationSteps.foldedSteps, noNextSteps: state.conversationStarted && nextStepsSelector(state).length == 0, noUserInput: noUserInputSelector(state), blockingInputControls: blockingInputControlsSelector(state), validInputEntered: validInputEnteredSelector(state) })) )( class Simulation extends React.Component { state = { displayAnswers: false } render() { let { noNextSteps, previousAnswers, noUserInput, conversationStarted, blockingInputControls, validInputEntered, targetsTriggerConversation } = this.props let arePreviousAnswers = previousAnswers.length > 0, displayConversation = (!targetsTriggerConversation || conversationStarted) && !blockingInputControls, showTargets = targetsTriggerConversation || !noUserInput return ( <> {this.state.displayAnswers && ( this.setState({ displayAnswers: false })} /> )} {!isEmpty(previousAnswers) && ( )} {displayConversation && ( <> {noNextSteps && ( <>

Plus de questions !

Vous avez atteint l'estimation la plus précise. {this.props.customEndMessages} )} )} {showTargets && ( {this.props.targets} )} {validInputEntered && ( Ce simulateur vous a plu ? } customEventName="rate simulator" /> )} {!noUserInput && this.props.explanation} ) } } )