tehseen01 / instagram-clone

This repository contains the code for an Instagram clone, a frontend web application built using Next.js and Tailwind CSS. It aims to replicate the core features and design of the popular social media platform, Instagram.
https://instagram-clone-tehseen01.vercel.app
MIT License
4 stars 1 forks source link

#2 improve the username sign up validation #6

Closed bonapartbon closed 1 year ago

bonapartbon commented 1 year ago

I fixed and tested the issue. It works fine now.

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to a Personal Account owned by @tehseen01 on Vercel.

@tehseen01 first needs to authorize it.

bonapartbon commented 1 year ago

@tehseen01 you can see it here. Thanks

bonapartbon commented 1 year ago

Hi, thanks for your contribution. I have a few suggestions to improve the username sign up validation:

  • You can use a more descriptive error message for the regex pattern, such as “Username can only contain lowercase letters, numbers, hyphens, dots and underscores”.
  • You can use Yup.string().required(“Username is required”) instead of Yup.string().required(“*This field is required”), to make it clear which field is missing.
  • Here is how the code would look like after applying these suggestions:
    .matches(/^[a-z0-9-._]+$/, "Username can only contain lowercase letters, numbers and  . _ -")
    .min(2)
    .max(25)
    .required("Username is required"),```

I made those changes. Thanks!

bonapartbon commented 1 year ago

Thanks for contributing

Sure, I'll try to contribute more on your project.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
instagram-clone ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2023 7:26am