From 35142990d399a2d717517fa90e907f7a260a3e4f Mon Sep 17 00:00:00 2001 From: lytrankieio123 Date: Fri, 1 Oct 2021 09:23:15 +0700 Subject: [PATCH] :recycle: enhan: submit form register when press enter :%s --- .../components/FormRegister/FormRegister.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx b/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx index c08b9120f..e3d0a8417 100644 --- a/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx +++ b/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx @@ -48,7 +48,7 @@ const FormRegister = ({ onSwitch, isHide }: Props) => { const onSignupCallBack = (isSuccess: boolean, message?: string) => { if (isSuccess) { - showMessageSuccess("Create account successfully. Please verify your email to login.") + showMessageSuccess("Create account successfully. Please verify your email to login.", 15000) } else { showMessageError(message || LANGUAGE.MESSAGE.ERROR) } @@ -71,7 +71,7 @@ const FormRegister = ({ onSwitch, isHide }: Props) => { validationSchema={DisplayingErrorMessagesSchema} onSubmit={onSignup} > - {({ errors, touched }) => ( + {({ errors, touched, isValid, submitForm }) => (
{ ? errors.password.toString() : '' } + onEnter={isValid ? submitForm : undefined} />
Must contain 8 characters with at least 1 uppercase and 1