From 12c68d1f8ade228141c1d414b4f1da32dbb13bfd Mon Sep 17 00:00:00 2001 From: Mael Date: Fri, 16 Nov 2018 16:02:19 +0000 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20de=20la=20simulation=20g?= =?UTF-8?q?=C3=A9n=C3=A9rique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/GenericSimulation.js | 15 ++++++++++++--- source/components/Targets.js | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/source/components/GenericSimulation.js b/source/components/GenericSimulation.js index 1bad1cda6..8c26786cf 100644 --- a/source/components/GenericSimulation.js +++ b/source/components/GenericSimulation.js @@ -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 (

Quel est l'impact de vos douches ?

- {!isEmpty(this.props.previousAnswers) && ( + {!isEmpty(previousAnswers) && (
) diff --git a/source/components/Targets.js b/source/components/Targets.js index 2e6e675f2..d2a7c773b 100644 --- a/source/components/Targets.js +++ b/source/components/Targets.js @@ -23,7 +23,7 @@ export default class Targets extends React.Component { {/*{title} {' : '} */} - {nodeValue}{' '} + {nodeValue?.toFixed(1)}{' '} {unit}