Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonsueur/0d7eae71717712cf10af2a07b7c9ad36 to your computer and use it in GitHub Desktop.
Save brandonsueur/0d7eae71717712cf10af2a07b7c9ad36 to your computer and use it in GitHub Desktop.
class LastFixation extends React.Component {
componentDidMount() {
this.props.getLastFixation()
}
render() {
const { hasContracts, t, isContractsLoaded, lastFixation } = this.props
return (
hasContracts &&
isContractsLoaded && (
<Alert title={t('banner.last_fixation.title')}>
<b>{t('banner.last_fixation.description')}</b>
<br />
<span>
{t('banner.last_fixation.last_date_fixation')} : Thursday 6 February
2020 - {' ' + t('banner.last_fixation.contract')} : test -{' '}
{' ' + t('banner.last_fixation.period')} : February to April 2021 -{' '}
{' ' + t('banner.last_fixation.fixation')} : 30%
</span>
</Alert>
)
)
}
}
const mapStateToProps = state => ({
isContractsLoaded: !state.contractReducer.loading,
contracts: contracts(state),
lastFixation: lastFixation(state),
hasContracts: hasContracts(state),
})
const mapDispatchToProps = dispatch => ({
getContracts: () => dispatch(getContracts()),
getLastFixation: () => dispatch(getLastFixation()),
})
export default connect(
mapStateToProps,
mapDispatchToProps,
)(withTranslation()(LastFixation))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment