diff options
author | 2019-01-07 23:53:32 +0100 | |
---|---|---|
committer | 2019-01-07 23:53:32 +0100 | |
commit | 8fce9fb5ce8a91a0905730efcdbd61ad3fcad6bf (patch) | |
tree | 899a872633f8c87a7ebb067b40b1ff1369851527 /src/components/settings/user | |
parent | Merge (diff) | |
download | ferdium-app-8fce9fb5ce8a91a0905730efcdbd61ad3fcad6bf.tar.gz ferdium-app-8fce9fb5ce8a91a0905730efcdbd61ad3fcad6bf.tar.zst ferdium-app-8fce9fb5ce8a91a0905730efcdbd61ad3fcad6bf.zip |
wip
Diffstat (limited to 'src/components/settings/user')
-rw-r--r-- | src/components/settings/user/EditUserForm.js | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/components/settings/user/EditUserForm.js b/src/components/settings/user/EditUserForm.js index 0e3ac6b10..f9b60dc52 100644 --- a/src/components/settings/user/EditUserForm.js +++ b/src/components/settings/user/EditUserForm.js | |||
@@ -3,15 +3,16 @@ 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, intlShape } from 'react-intl'; |
5 | import { Link } from 'react-router'; | 5 | import { Link } from 'react-router'; |
6 | 6 | import { Input } from '@meetfranz/forms'; | |
7 | // import { Link } from 'react-router'; | ||
8 | 7 | ||
9 | import Form from '../../../lib/Form'; | 8 | import Form from '../../../lib/Form'; |
10 | import Input from '../../ui/Input'; | 9 | // import Input from '../../ui/Input'; |
11 | import Button from '../../ui/Button'; | 10 | import Button from '../../ui/Button'; |
12 | import Radio from '../../ui/Radio'; | 11 | import Radio from '../../ui/Radio'; |
13 | import Infobox from '../../ui/Infobox'; | 12 | import Infobox from '../../ui/Infobox'; |
14 | 13 | ||
14 | console.log('input', Input); | ||
15 | |||
15 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
16 | headline: { | 17 | headline: { |
17 | id: 'settings.account.headline', | 18 | id: 'settings.account.headline', |
@@ -39,13 +40,12 @@ const messages = defineMessages({ | |||
39 | }, | 40 | }, |
40 | }); | 41 | }); |
41 | 42 | ||
42 | export default @observer class EditServiceForm extends Component { | 43 | export default @observer class EditUserForm extends Component { |
43 | static propTypes = { | 44 | static propTypes = { |
44 | status: MobxPropTypes.observableArray.isRequired, | 45 | status: MobxPropTypes.observableArray.isRequired, |
45 | form: PropTypes.instanceOf(Form).isRequired, | 46 | form: PropTypes.instanceOf(Form).isRequired, |
46 | onSubmit: PropTypes.func.isRequired, | 47 | onSubmit: PropTypes.func.isRequired, |
47 | isSaving: PropTypes.bool.isRequired, | 48 | isSaving: PropTypes.bool.isRequired, |
48 | isEnterprise: PropTypes.bool.isRequired, | ||
49 | }; | 49 | }; |
50 | 50 | ||
51 | static contextTypes = { | 51 | static contextTypes = { |
@@ -68,7 +68,6 @@ export default @observer class EditServiceForm extends Component { | |||
68 | // user, | 68 | // user, |
69 | status, | 69 | status, |
70 | form, | 70 | form, |
71 | isEnterprise, | ||
72 | isSaving, | 71 | isSaving, |
73 | } = this.props; | 72 | } = this.props; |
74 | const { intl } = this.context; | 73 | const { intl } = this.context; |
@@ -98,23 +97,21 @@ export default @observer class EditServiceForm extends Component { | |||
98 | )} | 97 | )} |
99 | <h2>{intl.formatMessage(messages.headlineAccount)}</h2> | 98 | <h2>{intl.formatMessage(messages.headlineAccount)}</h2> |
100 | <div className="grid__row"> | 99 | <div className="grid__row"> |
101 | <Input field={form.$('firstname')} focus /> | 100 | <Input {...form.$('firstname').bind()} focus /> |
102 | <Input field={form.$('lastname')} /> | 101 | <Input {...form.$('lastname').bind()} /> |
103 | </div> | 102 | </div> |
104 | <Input field={form.$('email')} /> | 103 | <Input {...form.$('email').bind()} /> |
105 | {!isEnterprise && ( | 104 | <Radio field={form.$('accountType')} /> |
106 | <Radio field={form.$('accountType')} /> | 105 | {form.$('accountType').value === 'company' && ( |
107 | )} | ||
108 | {!isEnterprise && form.$('accountType').value === 'company' && ( | ||
109 | <Input field={form.$('organization')} /> | 106 | <Input field={form.$('organization')} /> |
110 | )} | 107 | )} |
111 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> | 108 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> |
112 | <Input | 109 | <Input |
113 | field={form.$('oldPassword')} | 110 | {...form.$('oldPassword').bind()} |
114 | showPasswordToggle | 111 | showPasswordToggle |
115 | /> | 112 | /> |
116 | <Input | 113 | <Input |
117 | field={form.$('newPassword')} | 114 | {...form.$('newPassword').bind()} |
118 | showPasswordToggle | 115 | showPasswordToggle |
119 | scorePassword | 116 | scorePassword |
120 | /> | 117 | /> |