mon-entreprise/source/components/ProgressTip.js

45 lines
1.0 KiB
JavaScript
Raw Normal View History

import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
2017-12-20 15:21:29 +00:00
import { connect } from 'react-redux'
import { withRouter } from 'react-router'
import './ProgressTip.css'
import { Line } from 'rc-progress'
import { pick } from 'ramda'
@withRouter
@translate()
@connect(
pick(['foldedSteps', 'nextSteps', 'themeColours', 'conversationStarted'])
)
export default class ProgressTip extends Component {
render() {
2018-03-12 09:38:29 +00:00
let {
nextSteps,
foldedSteps,
themeColours: { colour, textColourOnWhite },
conversationStarted
2018-03-12 09:38:29 +00:00
} = this.props,
2017-12-20 15:21:29 +00:00
nbQuestions = nextSteps.length
2018-03-12 09:38:29 +00:00
if (!conversationStarted) return null
return (
2018-03-14 16:10:28 +00:00
<div className="progressTip">
{ nbQuestions != 0
?
<p style={{ color: textColourOnWhite }}>
2018-04-24 13:09:36 +00:00
{nbQuestions === 1
?
<Trans i18nKey="lastQ">dernière question !</Trans>
:
<Trans i18nKey="questionsLeft" count={nbQuestions}>
moins de {{nbQuestions}} questions
</Trans>
}
</p>
:
<br/>}
2018-03-14 16:10:28 +00:00
</div>
)
}
}