-
Notifications
You must be signed in to change notification settings - Fork 20
Issue Fix #1 , Trimming username #2
base: master
Are you sure you want to change the base?
Conversation
@kothariji is attempting to deploy a commit to a Personal Account owned by @ishandeveloper on Vercel. @ishandeveloper first needs to authorize it. |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/ishandeveloper/githubwrapped/f9orfs1w7 |
Hey @kothariji, Thanks for creating the PR. LGTM. I found an npm package, that can help serve this purpose : https://www.npmjs.com/package/github-username-regex Let me know, what do you think about this and if you'd be able to implement this : ) |
@ishandeveloper yaa i agree upon that part, but for that regex checking i don't think its a need to install the entire package We can use simple js to check if its matching or not. let github_username = new RegExp("^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$");
let result = github_username.test(username); This will work efficiently. |
@kothariji Definitely ! That'd be great 👍🏻 Feel free to go ahead. |
@ishandeveloper added an alert message whenever a user enters the wrong GitHub username So for that added material UI snackbar and MuiAlert. |
Instead of a snackbar, can we just change the helper text "Press 'Enter' to submit' to 'Please enter a valid username' ? and disable the submit on enter key, if that's the case? |
yes we can do that, but in my POI snackbar will alert the user that you have entered wrong username, also the |
Add
.trim( )
function to remove unnecessary trailing and leading spaces and tabs from the username, which is logically correct also as GitHub username should not contain any space.Issue reference #1.
Please let me know if there are any changes. 👍