Skip to content
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

add task solution #2723

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KrainovaAnastasia
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your hard work on the NewMovie component! 🎬 While your implementation meets many of the task requirements, there are some critical issues with the onChange handlers that need to be addressed. Each set function (like setImdbId, setImdbUrl, setImgUrl, setDescription, and setTitle) should be used as an onChange handler that takes an event and updates the state accordingly. This is crucial for the form to function correctly. Once these issues are resolved, your component will be in great shape! Keep up the great work and don't hesitate to reach out if you need any help. 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

value=""
onChange={() => {}}
value={title}
onChange={setTitle}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onChange prop for the TextField component should be a function that takes an event and updates the state. Currently, setTitle is being passed directly, which is not correct unless TextField is designed to handle it. Ensure TextField calls the onChange function with the new value or event.

<TextField
name="description"
label="Description"
onChange={setDescription}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous comment, ensure that setDescription is correctly used as the onChange handler. It should be a function that takes an event and updates the state.

name="imgUrl"
label="Image URL"
value={imgUrl}
onChange={setImgUrl}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that setImgUrl is correctly used as the onChange handler. It should be a function that takes an event and updates the state.

name="imdbUrl"
label="Imdb URL"
value={imdbUrl}
onChange={setImdbUrl}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that setImdbUrl is correctly used as the onChange handler. It should be a function that takes an event and updates the state.

name="imdbId"
label="Imdb ID"
value={imdbId}
onChange={setImdbId}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that setImdbId is correctly used as the onChange handler. It should be a function that takes an event and updates the state.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Great job on implementing the NewMovie component! 🎉 While your solution meets most of the task requirements, there are a few areas for improvement:

  1. onChange Handlers: Ensure that the onChange handlers for the TextField components are correctly implemented to handle events, not just string values. This is crucial for maintaining React's standard practices.

  2. Form Validation: Make sure the form validation logic is robust. The isFormValid variable should accurately reflect whether all required fields (title, imgUrl, imdbUrl, and imdbId) are filled out. Additionally, ensure that the onBlur functionality for validation is properly integrated.

  3. Code Style: Avoid using one-letter variable names for event handlers. Descriptive names improve code readability and maintainability.

  4. MoviesList Component: Verify that the MoviesList component is correctly handling the movies prop and is capable of rendering the list of movies.

These adjustments will enhance the functionality and readability of your code. Keep up the good work, and use this feedback to refine your skills! Remember, addressing these issues will help you avoid similar problems in the future. Happy coding! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +34 to +35
const isFormValid =
title.trim() && imgUrl.trim() && imdbUrl.trim() && imdbId.trim();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isFormValid variable is used to determine if the form can be submitted. Ensure that all required fields are correctly validated. Currently, it checks if title, imgUrl, imdbUrl, and imdbId are non-empty, which seems correct given the required fields. However, ensure this logic aligns with your form validation requirements.

</div>
</form>
</form>
<MoviesList movies={movies} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the MoviesList component is correctly implemented to handle the movies prop. Verify that it exists and is capable of rendering the list of movies passed to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants