2018-11-16 14:13:18 +00:00
|
|
|
import React from 'react'
|
|
|
|
import { Trans, translate } from 'react-i18next'
|
2018-11-14 10:24:13 +00:00
|
|
|
import { Field } from 'redux-form'
|
2018-11-14 17:24:57 +00:00
|
|
|
import './PeriodSwitch.css'
|
|
|
|
import { reduxForm } from 'redux-form'
|
2018-11-16 14:13:18 +00:00
|
|
|
import { compose } from 'ramda'
|
2018-11-14 10:24:13 +00:00
|
|
|
|
2018-11-16 14:13:18 +00:00
|
|
|
export default compose(
|
|
|
|
reduxForm({
|
|
|
|
form: 'conversation',
|
|
|
|
destroyOnUnmount: false,
|
|
|
|
initialValues: { période: 'mois' }
|
|
|
|
}),
|
|
|
|
translate()
|
|
|
|
)(function PeriodSwitch() {
|
2018-11-14 10:24:13 +00:00
|
|
|
return (
|
2018-11-14 17:24:57 +00:00
|
|
|
<div id="PeriodSwitch">
|
2018-11-14 10:24:13 +00:00
|
|
|
<>
|
|
|
|
<label>
|
|
|
|
<Field name="période" component="input" type="radio" value="mois" />
|
2018-11-14 17:24:57 +00:00
|
|
|
<span />
|
2018-11-16 14:13:18 +00:00
|
|
|
<span className="radioText">
|
|
|
|
<Trans>Mois</Trans>
|
|
|
|
</span>
|
2018-11-14 10:24:13 +00:00
|
|
|
</label>
|
2018-11-14 17:24:57 +00:00
|
|
|
|
2018-11-14 10:24:13 +00:00
|
|
|
<label>
|
|
|
|
<Field name="période" component="input" type="radio" value="année" />
|
2018-11-14 17:24:57 +00:00
|
|
|
<span />
|
|
|
|
|
2018-11-16 14:13:18 +00:00
|
|
|
<span className="radioText">
|
|
|
|
<Trans>Année</Trans>
|
|
|
|
</span>
|
2018-11-14 10:24:13 +00:00
|
|
|
</label>
|
|
|
|
</>
|
2018-11-14 17:24:57 +00:00
|
|
|
</div>
|
2018-11-14 10:24:13 +00:00
|
|
|
)
|
2018-11-14 17:24:57 +00:00
|
|
|
})
|