diff options
Diffstat (limited to 'src/components/ui/Input.js')
-rw-r--r-- | src/components/ui/Input.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/ui/Input.js b/src/components/ui/Input.js index 8d37d7a05..fa1b44699 100644 --- a/src/components/ui/Input.js +++ b/src/components/ui/Input.js | |||
@@ -5,7 +5,9 @@ import { Field } from 'mobx-react-form'; | |||
5 | import classnames from 'classnames'; | 5 | import classnames from 'classnames'; |
6 | import { defineMessages, injectIntl } from 'react-intl'; | 6 | import { defineMessages, injectIntl } from 'react-intl'; |
7 | 7 | ||
8 | import { mdiEye, mdiEyeOff } from '@mdi/js'; | ||
8 | import { scorePassword as scorePasswordFunc } from '../../helpers/password-helpers'; | 9 | import { scorePassword as scorePasswordFunc } from '../../helpers/password-helpers'; |
10 | import { Icon } from './icon'; | ||
9 | 11 | ||
10 | const messages = defineMessages({ | 12 | const messages = defineMessages({ |
11 | passwordToggle: { | 13 | passwordToggle: { |
@@ -14,7 +16,6 @@ const messages = defineMessages({ | |||
14 | }, | 16 | }, |
15 | }); | 17 | }); |
16 | 18 | ||
17 | @observer | ||
18 | class Input extends Component { | 19 | class Input extends Component { |
19 | static propTypes = { | 20 | static propTypes = { |
20 | field: PropTypes.instanceOf(Field).isRequired, | 21 | field: PropTypes.instanceOf(Field).isRequired, |
@@ -115,9 +116,6 @@ class Input extends Component { | |||
115 | type="button" | 116 | type="button" |
116 | className={classnames({ | 117 | className={classnames({ |
117 | 'franz-form__input-modifier': true, | 118 | 'franz-form__input-modifier': true, |
118 | mdi: true, | ||
119 | 'mdi-eye': !this.state.showPassword, | ||
120 | 'mdi-eye-off': this.state.showPassword, | ||
121 | })} | 119 | })} |
122 | onClick={() => | 120 | onClick={() => |
123 | this.setState(prevState => ({ | 121 | this.setState(prevState => ({ |
@@ -126,7 +124,9 @@ class Input extends Component { | |||
126 | } | 124 | } |
127 | tabIndex={-1} | 125 | tabIndex={-1} |
128 | aria-label={intl.formatMessage(messages.passwordToggle)} | 126 | aria-label={intl.formatMessage(messages.passwordToggle)} |
129 | /> | 127 | > |
128 | <Icon icon={this.state.showPassword ? mdiEye : mdiEyeOff} /> | ||
129 | </button> | ||
130 | )} | 130 | )} |
131 | {scorePassword && ( | 131 | {scorePassword && ( |
132 | <div className="franz-form__password-score"> | 132 | <div className="franz-form__password-score"> |
@@ -152,4 +152,4 @@ class Input extends Component { | |||
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | export default injectIntl(Input); | 155 | export default injectIntl(observer(Input)); |