From 7e88b0137ea193e29e26f4b75ddea3286db90beb Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Tue, 31 Jul 2018 16:45:21 +0200 Subject: [PATCH] =?UTF-8?q?r=C3=A9tabli=20le=20bouton=20de=20suppression?= =?UTF-8?q?=20de=20toutes=20les=20r=C3=A9ponses=20pr=C3=A9c=C3=A9dentes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/AnswerList.js | 16 +++++- source/components/GoToExplanations.js | 33 ------------ source/components/conversation/FoldedSteps.js | 51 ------------------- 3 files changed, 15 insertions(+), 85 deletions(-) delete mode 100644 source/components/GoToExplanations.js diff --git a/source/components/AnswerList.js b/source/components/AnswerList.js index 3f376fe72..937aba6e1 100644 --- a/source/components/AnswerList.js +++ b/source/components/AnswerList.js @@ -1,3 +1,4 @@ +import { resetSimulation } from 'Actions/actions' import Montant from 'Components/Montant' import Overlay from 'Components/Overlay' import RuleLink from 'Components/RuleLink' @@ -29,9 +30,21 @@ const formatAnswer = (answer, language) => { return answer.valeur } -const AnswerList = ({ answers, onClose, language, changeAnswer }) => ( +const AnswerList = ({ + answers, + onClose, + language, + changeAnswer, + resetSimulation +}) => (

My answers

+

+ 🗑{' '} + +

{answers.map(answer => ( @@ -67,6 +80,7 @@ export default compose( connect( state => ({ answers: answerWithValueSelector(state) }), dispatch => ({ + resetSimulation: () => dispatch(resetSimulation()), changeAnswer: question => dispatch({ type: 'STEP_ACTION', diff --git a/source/components/GoToExplanations.js b/source/components/GoToExplanations.js deleted file mode 100644 index f98f2d950..000000000 --- a/source/components/GoToExplanations.js +++ /dev/null @@ -1,33 +0,0 @@ -import withColours from 'Components/utils/withColours' -import withTracker from 'Components/utils/withTracker' -import React, { Component } from 'react' -import { Trans, translate } from 'react-i18next' -import { Element, scroller } from 'react-scroll' -import { LinkButton } from 'Ui/Button' -import './conversation/conversation.css' - -@translate() -@withColours -@withTracker -export default class GoToExplanation extends Component { - handleScrollToResults = () => { - this.props.tracker.push(['trackEvent', 'simulation', 'goToExplanation']) - scroller.scrollTo('resultsScrollElement', { - smooth: true, - duration: 200, - delay: 0 - }) - } - render() { - return ( - - -