diff --git a/source/components/ProgressTip.js b/source/components/ProgressTip.js index 0d06276fe..b1154cda0 100644 --- a/source/components/ProgressTip.js +++ b/source/components/ProgressTip.js @@ -1,13 +1,13 @@ import React, { Component } from 'react' -import { connect } from "react-redux" -import { withRouter } from "react-router" +import { connect } from 'react-redux' +import { withRouter } from 'react-router' import './ProgressTip.css' @withRouter @connect(state => ({ done: state.done, foldedSteps: state.foldedSteps, - nextSteps: state.nextSteps, + nextSteps: state.nextSteps })) export default class ProgressTip extends Component { state = { @@ -20,22 +20,23 @@ export default class ProgressTip extends Component { }) } render() { - let {done, nextSteps, foldedSteps} = this.props + let { done, nextSteps, foldedSteps } = this.props, + nbQuestions = nextSteps.length if (!done) return null return (
- {nextSteps.length != 0 && - this.state.nbFoldedStepsForFirstEstimation === - foldedSteps.length && ( + {nbQuestions != 0 && + this.state.nbFoldedStepsForFirstEstimation === foldedSteps.length && (

Votre première estimation est disponible !

)} - {nextSteps.length != 0 && ( + {nbQuestions != 0 && (

- Il reste environ {nextSteps.length}{' '} - {nextSteps.length === 1 ? 'question' : 'questions'} + {nbQuestions === 1 + ? 'Une dernière question !' + : `Il reste moins de ${nbQuestions} questions`}

)}