mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
This commit is contained in:
parent
1aae94fedc
commit
bc2a5aaf96
@ -54,10 +54,7 @@ export const CreateAccount = ({ onActionComplete }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
const onSubmit = async (event) => {
|
||||||
<Box
|
|
||||||
as="form"
|
|
||||||
onSubmit={async (event) => {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -82,8 +79,10 @@ export const CreateAccount = ({ onActionComplete }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}
|
};
|
||||||
>
|
|
||||||
|
return (
|
||||||
|
<Box as="form" onSubmit={onSubmit}>
|
||||||
<FormTextField
|
<FormTextField
|
||||||
autoFocus
|
autoFocus
|
||||||
label={t('accountName')}
|
label={t('accountName')}
|
||||||
@ -91,6 +90,11 @@ export const CreateAccount = ({ onActionComplete }) => {
|
|||||||
onChange={(event) => setNewAccountName(event.target.value)}
|
onChange={(event) => setNewAccountName(event.target.value)}
|
||||||
helpText={errorMessage}
|
helpText={errorMessage}
|
||||||
error={!isValidAccountName}
|
error={!isValidAccountName}
|
||||||
|
onKeyPress={(e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
onSubmit(e);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Box display={Display.Flex} marginTop={6} gap={2}>
|
<Box display={Display.Flex} marginTop={6} gap={2}>
|
||||||
<ButtonSecondary onClick={() => onActionComplete()} block>
|
<ButtonSecondary onClick={() => onActionComplete()} block>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user