Skip to content

VolodymyrKirichenko/react_movies-list-add-form

 
 

Repository files navigation

Movies list - Add Form

You have the App with the MoviesList and NewMovie form containing ready to use TextField components. Learn how it works and implement an ability to add movies from IMDB.

Use DevTools -> Network -> Img to get the first image from a movie page

Here is the demo page

  1. NewMovie should check if title, imgUrl, imdbUrl, imdbId are entered when an input looses focus (onBlur) and show an error and a red border if needed (learn how it it implemented in the TextField);
  2. The description is optional;
  3. Disable the submit button until all the required fields are filled;
  4. Clear the form after adding a new movie.
  5. Errors should not be shown after clearing the form (change its key to reinitialize the form);

(Optional) Advanced validation

Implement the ability to add custom validation callback to the TextField. Check if imgUrl and imdbUrl are valid URLs (you can use the next regex)

const pattern = /^((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)$/;

Instructions

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 72.6%
  • TypeScript 24.0%
  • SCSS 1.9%
  • HTML 1.4%
  • Shell 0.1%