Amélioration de la simulation générique

publicodes
Mael 2018-11-16 16:02:19 +00:00
parent 5a8e14469b
commit 12c68d1f8a
2 changed files with 13 additions and 4 deletions

View File

@ -6,21 +6,24 @@ import Conversation from 'Components/conversation/Conversation'
import withColours from 'Components/utils/withColours'
import Targets from 'Components/Targets'
import './GenericSimulation.css'
import { nextStepsSelector } from 'Selectors/analyseSelectors'
@withColours
@connect(state => ({
previousAnswers: state.conversationSteps.foldedSteps
previousAnswers: state.conversationSteps.foldedSteps,
noNextSteps: nextStepsSelector(state).length == 0
}))
export default class YO extends React.Component {
state = {
displayAnswers: false
}
render() {
let colours = this.props.colours
let { colours, noNextSteps, previousAnswers } = this.props
console.log(noNextSteps)
return (
<div className="ui__ container" id="GenericSimulation">
<h1>Quel est l'impact de vos douches ? </h1>
{!isEmpty(this.props.previousAnswers) && (
{!isEmpty(previousAnswers) && (
<button
style={{ background: colours.colour, color: colours.textColour }}
onClick={() => this.setState({ displayAnswers: true })}>
@ -34,6 +37,12 @@ export default class YO extends React.Component {
<Conversation
textColourOnWhite={this.props.colours.textColourOnWhite}
/>
{noNextSteps && (
<>
<h2>Plus de questions ! </h2>
<p>Vous avez atteint l'estimation la plus précise.</p>
</>
)}
<Targets />
</div>
)

View File

@ -23,7 +23,7 @@ export default class Targets extends React.Component {
{/*<span className="title">{title}</span>
{' : '} */}
<span className="figure">
<span className="value">{nodeValue}</span>{' '}
<span className="value">{nodeValue?.toFixed(1)}</span>{' '}
<span className="unit">{unit}</span>
</span>
<Link