mon-entreprise/source/components/SalaryExplanation.js

50 lines
1.5 KiB
JavaScript

import { startConversation } from 'Actions/actions'
import withTracker from 'Components/utils/withTracker'
import { compose } from 'ramda'
import { React, T } from 'Components'
import { connect } from 'react-redux'
import { formValueSelector } from 'redux-form'
import ficheDePaieSelectors from 'Selectors/ficheDePaieSelectors'
import * as Animate from 'Ui/animate'
import SalaryCompactExplanation from './SalaryCompactExplanation'
import './SalaryCompactExplanation.css'
import SalaryFirstExplanation from './SalaryFirstExplanation'
export default compose(
withTracker,
connect(
state => ({
conversationStarted: state.conversationStarted,
displayResults: !!ficheDePaieSelectors(state),
arePreviousAnswers: state.conversationSteps.foldedSteps.length > 0,
period: formValueSelector('conversation')(state, 'période')
}),
{
startConversation
}
)
)(
class SalaryExplanation extends React.Component {
render() {
return (
<Animate.fromBottom delay={2000}>
<p>
<T k="simulateurs.salarié.description">
Dès que le salarié est déclaré et payé, il est couvert par le
régime général de la Sécurité sociale (santé, maternité,
invalidité, vieillesse, maladie professionnelle et accidents) et
chômage.
</T>
</p>
{!this.props.conversationStarted ? (
<SalaryFirstExplanation {...this.props} />
) : (
<SalaryCompactExplanation {...this.props} />
)}
<div style={{ textAlign: 'center' }} />
</Animate.fromBottom>
)
}
}
)