Browse Source

Fix submit of account settings

develop
meriadec 6 years ago
committed by Juan Cortes Ross
parent
commit
b8cfb93316
No known key found for this signature in database GPG Key ID: 34A99C03E9455EB8
  1. 11
      src/components/modals/AccountSettingRenderBody.js

11
src/components/modals/AccountSettingRenderBody.js

@ -123,7 +123,7 @@ class AccountSettingRenderBody extends PureComponent<Props, State> {
}) })
handleSubmit = (account: Account, onClose: () => void) => ( handleSubmit = (account: Account, onClose: () => void) => (
e: SyntheticEvent<HTMLFormElement>, e: SyntheticEvent<HTMLFormElement | HTMLInputElement>,
) => { ) => {
e.preventDefault() e.preventDefault()
const { updateAccount, setDataModal } = this.props const { updateAccount, setDataModal } = this.props
@ -199,12 +199,14 @@ class AccountSettingRenderBody extends PureComponent<Props, State> {
blockHeight: account.blockHeight, blockHeight: account.blockHeight,
} }
const onSubmit = this.handleSubmit(account, onClose)
return ( return (
<ModalBody <ModalBody
onClose={onClose} onClose={onClose}
title={t('account.settings.title')} title={t('account.settings.title')}
render={() => ( render={() => (
<form onSubmit={this.handleSubmit(account, onClose)}> <Fragment>
<TrackPage category="Modal" name="AccountSettings" /> <TrackPage category="Modal" name="AccountSettings" />
<Container> <Container>
<Box> <Box>
@ -218,6 +220,7 @@ class AccountSettingRenderBody extends PureComponent<Props, State> {
value={account.name} value={account.name}
maxLength={MAX_ACCOUNT_NAME_SIZE} maxLength={MAX_ACCOUNT_NAME_SIZE}
onChange={this.handleChangeName} onChange={this.handleChangeName}
onEnter={onSubmit}
onFocus={e => this.handleFocus(e, 'accountName')} onFocus={e => this.handleFocus(e, 'accountName')}
error={accountNameError} error={accountNameError}
/> />
@ -289,7 +292,7 @@ class AccountSettingRenderBody extends PureComponent<Props, State> {
subTitle={t('common.areYouSure')} subTitle={t('common.areYouSure')}
desc={t('settings.removeAccountModal.desc')} desc={t('settings.removeAccountModal.desc')}
/> />
</form> </Fragment>
)} )}
renderFooter={() => ( renderFooter={() => (
<Fragment> <Fragment>
@ -301,7 +304,7 @@ class AccountSettingRenderBody extends PureComponent<Props, State> {
> >
{t('common.delete')} {t('common.delete')}
</Button> </Button>
<Button event="DoneEditingAccount" ml="auto" type="submit" primary> <Button event="DoneEditingAccount" ml="auto" onClick={onSubmit} primary>
{t('common.apply')} {t('common.apply')}
</Button> </Button>
</Fragment> </Fragment>

Loading…
Cancel
Save