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/settings/user/EditUserForm.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/settings/user/EditUserForm.js')
-rw-r--r-- | src/components/settings/user/EditUserForm.js | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/src/components/settings/user/EditUserForm.js b/src/components/settings/user/EditUserForm.js index db78acb69..4067881b8 100644 --- a/src/components/settings/user/EditUserForm.js +++ b/src/components/settings/user/EditUserForm.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; | 3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | import { Link } from 'react-router'; | 5 | import { Link } from 'react-router'; |
6 | import { Input } from '@meetfranz/forms'; | 6 | import { Input } from '@meetfranz/forms'; |
7 | 7 | ||
@@ -14,31 +14,32 @@ import Infobox from '../../ui/Infobox'; | |||
14 | const messages = defineMessages({ | 14 | const messages = defineMessages({ |
15 | headline: { | 15 | headline: { |
16 | id: 'settings.account.headline', | 16 | id: 'settings.account.headline', |
17 | defaultMessage: '!!!Account', | 17 | defaultMessage: 'Account', |
18 | }, | 18 | }, |
19 | headlineProfile: { | 19 | headlineProfile: { |
20 | id: 'settings.account.headlineProfile', | 20 | id: 'settings.account.headlineProfile', |
21 | defaultMessage: '!!!Update Profile', | 21 | defaultMessage: 'Update Profile', |
22 | }, | 22 | }, |
23 | headlineAccount: { | 23 | headlineAccount: { |
24 | id: 'settings.account.headlineAccount', | 24 | id: 'settings.account.headlineAccount', |
25 | defaultMessage: '!!!Account Information', | 25 | defaultMessage: 'Account Information', |
26 | }, | 26 | }, |
27 | headlinePassword: { | 27 | headlinePassword: { |
28 | id: 'settings.account.headlinePassword', | 28 | id: 'settings.account.headlinePassword', |
29 | defaultMessage: '!!!Change Password', | 29 | defaultMessage: 'Change Password', |
30 | }, | 30 | }, |
31 | successInfo: { | 31 | successInfo: { |
32 | id: 'settings.account.successInfo', | 32 | id: 'settings.account.successInfo', |
33 | defaultMessage: '!!!Your changes have been saved', | 33 | defaultMessage: 'Your changes have been saved', |
34 | }, | 34 | }, |
35 | buttonSave: { | 35 | buttonSave: { |
36 | id: 'settings.account.buttonSave', | 36 | id: 'settings.account.buttonSave', |
37 | defaultMessage: '!!!Update profile', | 37 | defaultMessage: 'Update profile', |
38 | }, | 38 | }, |
39 | }); | 39 | }); |
40 | 40 | ||
41 | export default @observer class EditUserForm extends Component { | 41 | @observer |
42 | class EditUserForm extends Component { | ||
42 | static propTypes = { | 43 | static propTypes = { |
43 | status: MobxPropTypes.observableArray.isRequired, | 44 | status: MobxPropTypes.observableArray.isRequired, |
44 | form: PropTypes.instanceOf(Form).isRequired, | 45 | form: PropTypes.instanceOf(Form).isRequired, |
@@ -46,14 +47,10 @@ export default @observer class EditUserForm extends Component { | |||
46 | isSaving: PropTypes.bool.isRequired, | 47 | isSaving: PropTypes.bool.isRequired, |
47 | }; | 48 | }; |
48 | 49 | ||
49 | static contextTypes = { | ||
50 | intl: intlShape, | ||
51 | }; | ||
52 | |||
53 | submit(e) { | 50 | submit(e) { |
54 | e.preventDefault(); | 51 | e.preventDefault(); |
55 | this.props.form.submit({ | 52 | this.props.form.submit({ |
56 | onSuccess: (form) => { | 53 | onSuccess: form => { |
57 | const values = form.values(); | 54 | const values = form.values(); |
58 | this.props.onSubmit(values); | 55 | this.props.onSubmit(values); |
59 | }, | 56 | }, |
@@ -68,7 +65,7 @@ export default @observer class EditUserForm extends Component { | |||
68 | form, | 65 | form, |
69 | isSaving, | 66 | isSaving, |
70 | } = this.props; | 67 | } = this.props; |
71 | const { intl } = this.context; | 68 | const { intl } = this.props; |
72 | 69 | ||
73 | return ( | 70 | return ( |
74 | <div className="settings__main"> | 71 | <div className="settings__main"> |
@@ -84,12 +81,9 @@ export default @observer class EditUserForm extends Component { | |||
84 | </span> | 81 | </span> |
85 | </div> | 82 | </div> |
86 | <div className="settings__body"> | 83 | <div className="settings__body"> |
87 | <form onSubmit={(e) => this.submit(e)} id="form"> | 84 | <form onSubmit={e => this.submit(e)} id="form"> |
88 | {status.length > 0 && status.includes('data-updated') && ( | 85 | {status.length > 0 && status.includes('data-updated') && ( |
89 | <Infobox | 86 | <Infobox type="success" icon="checkbox-marked-circle-outline"> |
90 | type="success" | ||
91 | icon="checkbox-marked-circle-outline" | ||
92 | > | ||
93 | {intl.formatMessage(messages.successInfo)} | 87 | {intl.formatMessage(messages.successInfo)} |
94 | </Infobox> | 88 | </Infobox> |
95 | )} | 89 | )} |
@@ -104,10 +98,7 @@ export default @observer class EditUserForm extends Component { | |||
104 | <Input field={form.$('organization')} /> | 98 | <Input field={form.$('organization')} /> |
105 | )} | 99 | )} |
106 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> | 100 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> |
107 | <Input | 101 | <Input {...form.$('oldPassword').bind()} showPasswordToggle /> |
108 | {...form.$('oldPassword').bind()} | ||
109 | showPasswordToggle | ||
110 | /> | ||
111 | <Input | 102 | <Input |
112 | {...form.$('newPassword').bind()} | 103 | {...form.$('newPassword').bind()} |
113 | showPasswordToggle | 104 | showPasswordToggle |
@@ -137,3 +128,5 @@ export default @observer class EditUserForm extends Component { | |||
137 | ); | 128 | ); |
138 | } | 129 | } |
139 | } | 130 | } |
131 | |||
132 | export default injectIntl(EditUserForm); | ||