Ajoute un bouton pour accéder à la répartition des cotisations

pull/587/head
Johan Girod 2019-07-01 19:14:22 +02:00
parent cf64ed5899
commit e577acbe3f
No known key found for this signature in database
GPG Key ID: 9E27B57DA2E8AE12
1 changed files with 18 additions and 2 deletions

View File

@ -2,7 +2,8 @@ import Distribution from 'Components/Distribution'
import PaySlip from 'Components/PaySlip'
import withTracker from 'Components/utils/withTracker'
import { compose } from 'ramda'
import React from 'react'
import React, { useRef } from 'react'
import emoji from 'react-easy-emoji'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
import { formValueSelector } from 'redux-form'
@ -29,6 +30,7 @@ export default compose(
showDistributionFirst: !state.conversationSteps.foldedSteps.length
}))
)(function SalaryExplanation({ showDistributionFirst }) {
const distributionRef = useRef({})
return (
<ErrorBoundary>
<Animate.fromTop key={showDistributionFirst}>
@ -39,8 +41,22 @@ export default compose(
</>
) : (
<>
<div css="text-align: center">
<button
className="ui__ small simple button"
onClick={() =>
distributionRef.current.scrollIntoView({
behavior: 'smooth',
block: 'start'
})
}>
{emoji('📊')} Voir la répartition des cotisations
</button>
</div>
<PaySlipSection />
<DistributionSection />
<div ref={distributionRef}>
<DistributionSection />
</div>
</>
)}
<br />