From e576a52608798a7daa6e6352db506d13e6b343aa Mon Sep 17 00:00:00 2001 From: "MSI\\derek" Date: Mon, 19 Aug 2024 15:14:39 +0800 Subject: [PATCH] update --- .../ChangePassword/ChangePasswordForm.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/ChangePassword/ChangePasswordForm.tsx b/src/components/ChangePassword/ChangePasswordForm.tsx index bdfc8b6..4553c64 100644 --- a/src/components/ChangePassword/ChangePasswordForm.tsx +++ b/src/components/ChangePassword/ChangePasswordForm.tsx @@ -85,7 +85,7 @@ const ChagnePasswordForm: React.FC = ({ pwRules:rules }) => } else if (index === 3 && rules.number && !/[0-9]/.test(inputValue)) { //testing for numbers return "red"; - } else if (index === 4 && rules.specialChar && !/[!@#$%^&-=+_*(),.?":{}|<>]/.test(inputValue)) { + } else if (index === 4 && rules.specialChar && !/[-!@#$%^&=+_*(),.?":{}|<>]/.test(inputValue)) { //testing for special characters return "red"; } else { @@ -94,6 +94,10 @@ const ChagnePasswordForm: React.FC = ({ pwRules:rules }) => }); }; + if (!/[-!@#$%^&=+_*(),.?":{}|<>]/.test('12')) { + console.log(!/[-!@#$%^&=+_*(),.?":{}|<>]/.test('12')) + } + const handleInputChange = (event: React.ChangeEvent) => { // Update the theme with the new color based on the input value const newInputValue = event.target.value; @@ -187,7 +191,9 @@ const ChagnePasswordForm: React.FC = ({ pwRules:rules }) => component: (props) => { return ( - {(props.children as string[]).map((line, index) => ( + {(props.children as string[]).map((line, index) => { + console.log(index, getColorFromInput(inputValue, msgList)[index]) + return ( = ({ pwRules:rules }) => )} {line} {index < - (props.children as string[]).length - 1 && ( + (props.children as string[]).length && (
)}
- ))} + )} + )}
); },