mon-entreprise/source/components/SalaryExplanation.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

import { startConversation } from 'Actions/actions';
import withTracker from 'Components/utils/withTracker';
import { compose } from 'ramda';
import React, { Component } from 'react';
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';
2019-01-17 14:34:44 +00:00
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 Component {
render() {
return (
<Animate.fromBottom delay={1000}>
2019-01-17 14:34:44 +00:00
{!this.props.conversationStarted ? (
<SalaryFirstExplanation {...this.props} />
) : (
<SalaryCompactExplanation {...this.props} />
)}
<div style={{ textAlign: 'center' }} />
</Animate.fromBottom>
)
}
}
)