mon-entreprise/source/components/PeriodSwitch.js

39 lines
826 B
JavaScript
Raw Normal View History

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'
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 (
<div id="PeriodSwitch">
2018-11-14 10:24:13 +00:00
<>
<label>
<Field name="période" component="input" type="radio" value="mois" />
<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 10:24:13 +00:00
<label>
<Field name="période" component="input" type="radio" value="année" />
<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>
</>
</div>
2018-11-14 10:24:13 +00:00
)
})