-
Notifications
You must be signed in to change notification settings - Fork 0
Debugging v1beta #37
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
Debugging v1beta #37
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
This pull request enhances username validation for both the Signup and ProfileSettings components.
- Updated both components to validate usernames against a stricter regex ensuring 3-20 characters with allowed symbols.
- Adjusted error handling and button labeling in Signup and reorganized error message rendering in ProfileSettings.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/components/signup/Signup.js | Added a new username validation function and integrated it into form checks; updated button label for consistency |
src/components/profileSettings/ProfileSettings.js | Replaced basic username length check with regex-based validation and repositioned error message rendering |
Files not reviewed (2)
- src/app/profile/profile.module.css: Language not supported
- src/components/profileSettings/ProfileSettings.module.css: Language not supported
const isUsernameValid = (username) => { | ||
const usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/; | ||
return usernameRegex.test(username); | ||
}; |
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.
The username validation function is duplicated across components. Consider extracting it into a shared utility module to reduce redundancy.
const isUsernameValid = (username) => { | |
const usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/; | |
return usernameRegex.test(username); | |
}; | |
import { isUsernameValid } from '../../utils/validation'; |
Copilot uses AI. Check for mistakes.
@@ -23,16 +23,25 @@ export const ProfileSettings = ({ currentUser }) => { | |||
})); | |||
}; | |||
|
|||
const isUsernameValid = (username) => { |
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.
The username validation function is duplicated across components. Consider extracting it into a shared utility module to reduce redundancy.
Copilot uses AI. Check for mistakes.
No description provided.