chore: all review comments

This commit is contained in:
2025-08-14 00:10:29 +03:30
parent 20da3f980e
commit c15e47b8b0
22 changed files with 137 additions and 583 deletions

View File

@@ -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 });