chore: all review comments
This commit is contained in:
@@ -41,6 +41,10 @@ export const CompleteSignUp = ({
|
||||
const handleBlur = () => {
|
||||
setTouched(true);
|
||||
|
||||
handleValueError();
|
||||
};
|
||||
|
||||
const handleValueError = () => {
|
||||
if (!value) {
|
||||
setError(t('loginForm.thisFieldIsRequired'));
|
||||
}
|
||||
@@ -52,15 +56,11 @@ export const CompleteSignUp = ({
|
||||
};
|
||||
|
||||
const handleCompleteSignUp = async () => {
|
||||
if (!value) {
|
||||
setError(t('loginForm.thisFieldIsRequired'));
|
||||
inputRef.current?.focus();
|
||||
}
|
||||
if (!isPhoneValid(countryCode, value)) {
|
||||
setError(t('loginForm.phoneNumberIsInvalid'));
|
||||
handleValueError();
|
||||
|
||||
if (!value || !isPhoneValid(countryCode, value)) {
|
||||
inputRef.current?.focus();
|
||||
} else {
|
||||
setError(undefined);
|
||||
setSendOtpLoading(true);
|
||||
|
||||
await sendSmsOtp({ phoneNumber: countryCode + value });
|
||||
|
||||
Reference in New Issue
Block a user