Skip to content

Commit

Permalink
Merge pull request #42 from AAISS/fix/signup-validation
Browse files Browse the repository at this point in the history
fix(signup): helper text of phone validation
  • Loading branch information
KimiaMontazeri authored Nov 29, 2023
2 parents 588295d + e3d5817 commit c5b9856
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frontend/src/pages/Signup/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Helper } from '../../utils/Helper.js';
const validatePhone = (phone) => {
const PHONE_LENGTH = 11;
const phoneStr = String(phone);
// 09102014779
const lengthIsOk = phoneStr.length === PHONE_LENGTH;
const startsWithZeroNine = phoneStr.startsWith('09');
return {
Expand Down Expand Up @@ -57,7 +56,7 @@ const SignUpForm = ({ onLoginClick }) => {
const { lengthIsOk, startsWithZeroNine } = validatePhone(phoneNumber);
if (!lengthIsOk) {
setIsPhoneWrong(true);
setPhoneHelperText('Phone number is two short');
setPhoneHelperText('Phone number should be 11 digits');
return false;
}
if (!startsWithZeroNine) {
Expand Down

0 comments on commit c5b9856

Please sign in to comment.