-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Email validation fixes #474
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@rajdip-b Can you please add hacktoberfest label? |
@@ -13,10 +13,12 @@ function Hero(): React.JSX.Element { | |||
const onSubmit = (e: React.FormEvent): void => { | |||
e.preventDefault() | |||
|
|||
if (email === '') { | |||
const emailRegex = /^[^\s@]+@[^\s@]+\.[\w]{2,}$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
([a-zA-Z0-9]+)([_.-{1}])?([a-zA-Z0-9]+)@([a-zA-Z0-9]+)([.])([a-zA-Z.]+)
@rajdip-b
I think this regex will do but it is failing pre commit checks because of es-lint, it says
"Capture group '([a-zA-Z0-9]+)' should be converted to a named or non-capturing group."
but if i change it to name capturing then it says
"Named capturing groups are only available when targeting 'ES2018' or later."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bansal-harsh-2504 you can just use email validation from zod, it will make your life easy
@bansal-harsh-2504 any particular reason why you have closed this? the pr looks good |
@rajdip-b Everytime i commit my changes somehow 50-60 files get modified on their own, so i have to delete the directory and clone the fork again after each commit and now after last commit it was showing that fork is 2 commits behind and 4 commits ahead , so i did not know what to do. I deleted the pr and fork, now i will create another pr and hopefully solve this issue. |
hmm, thats odd. You can use --no-verify flag when you commit. that will prevent the changes |
User description
Description
There was a bug where if we type email as xyz@xyz it was getting accepted but now i have implemented validation using regex now it email should look like [email protected].
Fixes #463
Dependencies
Future Improvements
Mentions
@rajdip-b @kriptonian1
##Screenshots
Old Behaviour
Current Behaviour
Developer's checklist
Documentation Update
not needed
PR Type
enhancement, bug fix
Description
Changes walkthrough 📝
index.tsx
Implement email validation and fix typo in error message
apps/web/src/components/hero/index.tsx