Created
April 29, 2020 07:36
-
-
Save brandonsueur/0d7eae71717712cf10af2a07b7c9ad36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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