From 914e07956b6f7837a114d1b068f76f808e0121fa Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 3 Jun 2020 13:48:30 +0200 Subject: [PATCH] :racehorse: ne calcul pas les prochaines questions si la simulation est vide --- .../source/components/Simulation.tsx | 99 ++++++++++--------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/mon-entreprise/source/components/Simulation.tsx b/mon-entreprise/source/components/Simulation.tsx index 0b10a89ab..adf61406d 100644 --- a/mon-entreprise/source/components/Simulation.tsx +++ b/mon-entreprise/source/components/Simulation.tsx @@ -38,55 +38,66 @@ export default function Simulation({ dispatch(setSimulationConfig(config, location.state?.fromGérer)) }, [config]) const firstStepCompleted = useSelector(firstStepCompletedSelector) - const progress = useSimulationProgress() return ( <> {firstStepCompleted && ( - <> - - {results} -
- {progress < 1 ? ( - - - Affinez la simulation en répondant aux questions : - - - ) : ( - - )} - -
-
-
- - -
-
- {progress < 1 && ( - - )} -
- - Êtes-vous satisfait de ce simulateur ? - - } - customEventName="rate simulator" - />{' '} - {explanations} -
- + + {results} + +
+ + Êtes-vous satisfait de ce simulateur ? + + } + customEventName="rate simulator" + />{' '} + {explanations} +
+ )} + + ) +} + +function Questions({ + customEndMessages +}: { + customEndMessages?: ConversationProps['customEndMessages'] +}) { + const progress = useSimulationProgress() + + return ( + <> +
+ {progress < 1 ? ( + + + Affinez la simulation en répondant aux questions : + + + ) : ( + + )} + +
+
+
+ + +
+
+ {progress < 1 && ( + )} )