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/Select.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/Select.js')
-rw-r--r-- | src/components/ui/Select.js | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/components/ui/Select.js b/src/components/ui/Select.js index e7a5eafa8..15b4c28e7 100644 --- a/src/components/ui/Select.js +++ b/src/components/ui/Select.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 Select extends Component { | 7 | @observer |
8 | class Select 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, |
@@ -43,13 +44,7 @@ export default @observer class Select extends Component { | |||
43 | } | 44 | } |
44 | 45 | ||
45 | render() { | 46 | render() { |
46 | const { | 47 | const { field, className, showLabel, disabled, multiple } = this.props; |
47 | field, | ||
48 | className, | ||
49 | showLabel, | ||
50 | disabled, | ||
51 | multiple, | ||
52 | } = this.props; | ||
53 | 48 | ||
54 | let selected = field.value; | 49 | let selected = field.value; |
55 | 50 | ||
@@ -74,15 +69,12 @@ export default @observer class Select extends Component { | |||
74 | })} | 69 | })} |
75 | > | 70 | > |
76 | {field.label && showLabel && ( | 71 | {field.label && showLabel && ( |
77 | <label | 72 | <label className="franz-form__label" htmlFor={field.name}> |
78 | className="franz-form__label" | ||
79 | htmlFor={field.name} | ||
80 | > | ||
81 | {field.label} | 73 | {field.label} |
82 | </label> | 74 | </label> |
83 | )} | 75 | )} |
84 | <select | 76 | <select |
85 | onChange={multiple ? (e) => this.multipleChange(e) : field.onChange} | 77 | onChange={multiple ? e => this.multipleChange(e) : field.onChange} |
86 | id={field.id} | 78 | id={field.id} |
87 | defaultValue={selected} | 79 | defaultValue={selected} |
88 | className="franz-form__select" | 80 | className="franz-form__select" |
@@ -90,7 +82,7 @@ export default @observer class Select extends Component { | |||
90 | multiple={multiple} | 82 | multiple={multiple} |
91 | ref={this.element} | 83 | ref={this.element} |
92 | > | 84 | > |
93 | {field.options.map((type) => ( | 85 | {field.options.map(type => ( |
94 | <option | 86 | <option |
95 | key={type.value} | 87 | key={type.value} |
96 | value={type.value} | 88 | value={type.value} |
@@ -100,14 +92,10 @@ export default @observer class Select extends Component { | |||
100 | </option> | 92 | </option> |
101 | ))} | 93 | ))} |
102 | </select> | 94 | </select> |
103 | {field.error && ( | 95 | {field.error && <div className="franz-form__error">{field.error}</div>} |
104 | <div | ||
105 | className="franz-form__error" | ||
106 | > | ||
107 | {field.error} | ||
108 | </div> | ||
109 | )} | ||
110 | </div> | 96 | </div> |
111 | ); | 97 | ); |
112 | } | 98 | } |
113 | } | 99 | } |
100 | |||
101 | export default Select; | ||