SecurityForm: Break ChangeEmailForm into separate component
This commit is contained in:
parent
f99d1300c2
commit
e972cfc191
1 changed files with 42 additions and 29 deletions
|
@ -20,10 +20,25 @@ const messages = defineMessages({
|
||||||
updateEmailFail: { id: 'security.update_email.fail', defaultMessage: 'Update email failed.' },
|
updateEmailFail: { id: 'security.update_email.fail', defaultMessage: 'Update email failed.' },
|
||||||
});
|
});
|
||||||
|
|
||||||
export default @connect()
|
export default @injectIntl
|
||||||
@injectIntl
|
|
||||||
class SecurityForm extends ImmutablePureComponent {
|
class SecurityForm extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { intl } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Column icon='lock' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||||
|
<ChangeEmailForm />
|
||||||
|
</Column>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@connect()
|
||||||
|
@injectIntl
|
||||||
|
class ChangeEmailForm extends ImmutablePureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
email: PropTypes.string,
|
email: PropTypes.string,
|
||||||
dispatch: PropTypes.func.isRequired,
|
dispatch: PropTypes.func.isRequired,
|
||||||
|
@ -59,33 +74,31 @@ class SecurityForm extends ImmutablePureComponent {
|
||||||
const { intl } = this.props;
|
const { intl } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='lock' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
<SimpleForm onSubmit={this.handleSubmit}>
|
||||||
<SimpleForm onSubmit={this.handleSubmit}>
|
<fieldset disabled={this.state.isLoading}>
|
||||||
<fieldset disabled={this.state.isLoading}>
|
<FieldsGroup>
|
||||||
<FieldsGroup>
|
<TextInput
|
||||||
<TextInput
|
label='Email address'
|
||||||
label='Email address'
|
placeholder='me@example.com'
|
||||||
placeholder='me@example.com'
|
name='email'
|
||||||
name='email'
|
onChange={this.handleInputChange}
|
||||||
onChange={this.handleInputChange}
|
value={this.state.email}
|
||||||
value={this.state.email}
|
/>
|
||||||
/>
|
<SimpleInput
|
||||||
<SimpleInput
|
type='password'
|
||||||
type='password'
|
label='Password'
|
||||||
label='Password'
|
name='password'
|
||||||
name='password'
|
onChange={this.handleInputChange}
|
||||||
onChange={this.handleInputChange}
|
value={this.state.password}
|
||||||
value={this.state.password}
|
/>
|
||||||
/>
|
<div className='actions'>
|
||||||
<div className='actions'>
|
<button name='button' type='submit' className='btn button button-primary'>
|
||||||
<button name='button' type='submit' className='btn button button-primary'>
|
{intl.formatMessage(messages.submit)}
|
||||||
{intl.formatMessage(messages.submit)}
|
</button>
|
||||||
</button>
|
</div>
|
||||||
</div>
|
</FieldsGroup>
|
||||||
</FieldsGroup>
|
</fieldset>
|
||||||
</fieldset>
|
</SimpleForm>
|
||||||
</SimpleForm>
|
|
||||||
</Column>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue