Skip to content

Commit 521c3bb

Browse files
matthappensLightspark Eng
authored andcommitted
Revert "Restrict first and last name input fields to be more than 1 c… (#22867)
…haracters and to not contain digits (#22563)" This reverts commit e6fc9162d884d82256e3ee71c8330edeebb53983. ## Reason there's an issue where sign up in mx is blocked, reverting this to be safe GitOrigin-RevId: 6ead3d065fd639bd7f7f1e309450801d0f794a90
1 parent 33685bf commit 521c3bb

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

packages/ui/src/hooks/useFields.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const defaultMsgs = {
2222
postalCode: "Please enter a valid zip code.",
2323
state: "Please enter a valid two-letter state abbreviation.",
2424
name: "Name must be at least three characters.",
25-
humanName: "Name must be at least 1 character and cannot contain digits",
2625
code: "Code must be eight characters long.",
2726
password:
2827
"Password must be at least 12 characters, must contain at least two types of characters: lowercase, uppercase, numbers, special",
@@ -40,7 +39,6 @@ const regexp = {
4039
phone: /^[0-9]{7,15}$/,
4140
postalCode: /(^\d{5}$)|(^\d{5}-\d{4}$)/,
4241
email: /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
43-
humanName: /^[^0-9]+$/,
4442
state:
4543
/^(A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$/,
4644
clabe: /^[0-9]{18}$/,
@@ -84,10 +82,6 @@ export const v: Validators = {
8482
(msg = defaultMsgs.name) =>
8583
(value) =>
8684
value.trim().length < 3 ? msg : false,
87-
humanName:
88-
(msg = defaultMsgs.humanName) =>
89-
(value) =>
90-
value.trim().length < 1 || !regexp.humanName.test(value) ? msg : false,
9185
code:
9286
(msg = defaultMsgs.code) =>
9387
(value) =>
@@ -167,7 +161,6 @@ const defaultValidators: Record<string, ValidatorFn[]> = {
167161
],
168162
city: [v.required("City is required.")],
169163
name: [v.required("Name is required."), v.name()],
170-
humanName: [v.required("Name is required."), v.humanName()],
171164
code: [v.required("Please enter a code."), v.code()],
172165
email: [v.required("Email is required."), v.email()],
173166
phoneNumber: [v.required("Phone number is required."), v.phone()],

0 commit comments

Comments
 (0)