diff options
author | 2021-09-13 14:45:46 +0200 | |
---|---|---|
committer | 2021-09-13 14:45:46 +0200 | |
commit | 537697a6e9757f118d09d9e76362ba1ff617e2c6 (patch) | |
tree | bc55447115e385137684e84697a8c15d2199b8d5 /src/components/ui/Radio.js | |
parent | Bumped up version to: 5.6.3-nightly.0 [skip ci] (diff) | |
download | ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.gz ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.zst ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.zip |
chore: upgrade intl dependencies (#1920)
Diffstat (limited to 'src/components/ui/Radio.js')
-rw-r--r-- | src/components/ui/Radio.js | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/components/ui/Radio.js b/src/components/ui/Radio.js index e77714eb7..65a777ff1 100644 --- a/src/components/ui/Radio.js +++ b/src/components/ui/Radio.js | |||
@@ -4,7 +4,8 @@ import { observer } from 'mobx-react'; | |||
4 | import { Field } from 'mobx-react-form'; | 4 | import { Field } from 'mobx-react-form'; |
5 | import classnames from 'classnames'; | 5 | import classnames from 'classnames'; |
6 | 6 | ||
7 | export default @observer class Radio extends Component { | 7 | @observer |
8 | class Radio extends Component { | ||
8 | static propTypes = { | 9 | static propTypes = { |
9 | field: PropTypes.instanceOf(Field).isRequired, | 10 | field: PropTypes.instanceOf(Field).isRequired, |
10 | className: PropTypes.string, | 11 | className: PropTypes.string, |
@@ -31,11 +32,7 @@ export default @observer class Radio extends Component { | |||
31 | } | 32 | } |
32 | 33 | ||
33 | render() { | 34 | render() { |
34 | const { | 35 | const { field, className, showLabel } = this.props; |
35 | field, | ||
36 | className, | ||
37 | showLabel, | ||
38 | } = this.props; | ||
39 | 36 | ||
40 | return ( | 37 | return ( |
41 | <div | 38 | <div |
@@ -46,15 +43,12 @@ export default @observer class Radio extends Component { | |||
46 | })} | 43 | })} |
47 | > | 44 | > |
48 | {field.label && showLabel && ( | 45 | {field.label && showLabel && ( |
49 | <label | 46 | <label className="franz-form__label" htmlFor={field.name}> |
50 | className="franz-form__label" | ||
51 | htmlFor={field.name} | ||
52 | > | ||
53 | {field.label} | 47 | {field.label} |
54 | </label> | 48 | </label> |
55 | )} | 49 | )} |
56 | <div className="franz-form__radio-wrapper"> | 50 | <div className="franz-form__radio-wrapper"> |
57 | {field.options.map((type) => ( | 51 | {field.options.map(type => ( |
58 | <label | 52 | <label |
59 | key={type.value} | 53 | key={type.value} |
60 | htmlFor={`${field.id}-${type.value}`} | 54 | htmlFor={`${field.id}-${type.value}`} |
@@ -75,14 +69,10 @@ export default @observer class Radio extends Component { | |||
75 | </label> | 69 | </label> |
76 | ))} | 70 | ))} |
77 | </div> | 71 | </div> |
78 | {field.error && ( | 72 | {field.error && <div className="franz-form__error">{field.error}</div>} |
79 | <div | ||
80 | className="franz-form__error" | ||
81 | > | ||
82 | {field.error} | ||
83 | </div> | ||
84 | )} | ||
85 | </div> | 73 | </div> |
86 | ); | 74 | ); |
87 | } | 75 | } |
88 | } | 76 | } |
77 | |||
78 | export default Radio; | ||