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

solution #2760

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

solution #2760

wants to merge 2 commits into from

Conversation

AlenaLoik
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 this Todo application! 😊 While your implementation is solid and follows React best practices, there are a few critical issues that need to be addressed before we can approve the pull request:

  1. Core Requirement Compliance: The task description specifies that the x button in the TodoFilter should clear the query and reset the todos. Currently, the x button clears the query, but it does not explicitly reset the todos. This is a core requirement that needs to be fulfilled.

  2. Checklist Compliance: The code does not use the classnames library for defining classes conditionally, which is a requirement from the checklist. This needs to be addressed to meet the task requirements.

Please address these issues to ensure the functionality aligns with the task requirements. Once these changes are made, your code will be in great shape! Keep up the great work, and feel free to reach out if you have any questions or need further assistance. 🚀

✨ 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.

/>
<span className="icon is-left">
<i className="fas fa-magnifying-glass" />
</span>

<span className="icon is-right" style={{ pointerEvents: 'all' }}>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
<button data-cy="clearSearchButton" type="button" className="delete" />
{query.length && (

Choose a reason for hiding this comment

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

Consider explicitly comparing query.length to zero for clarity and to avoid potential issues with falsy values. For example, use query.length > 0.

};

export const TodoModal: React.FC<Props> = ({ todo, closeModal }) => {
const [user, setUser] = useState({} as User);

Choose a reason for hiding this comment

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

Consider providing a more meaningful default state for user if possible, rather than casting an empty object to User.


{' by '}

<a href="mailto:[email protected]">Leanne Graham</a>
<a href="mailto:[email protected]">{user.name}</a>

Choose a reason for hiding this comment

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

The email link is hardcoded. Consider using user.email dynamically if available to ensure the email link corresponds to the fetched user.

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 core functionality of the Todo application! 🎉 The x button in the TodoFilter component now correctly clears the query and resets the todos, which aligns with the task requirements. However, there are a few areas for improvement:

  1. Utilize the classnames Library: The code currently does not use the classnames library for conditional class definitions, which is a requirement. This library can help manage class names more efficiently across components like App.tsx, TodoList.tsx, and TodoModal.tsx.

  2. Reset Todos Logic: Ensure that the logic for resetting todos is consistently implemented when the x button is clicked in the TodoFilter component.

These improvements will not only enhance the code quality but also ensure compliance with the task checklist. Keep up the great work and continue learning from these experiences! Your progress is commendable, and addressing these points will further strengthen your coding skills. 🚀

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

Comment on lines +69 to +73
<TodoFilter
query={query}
searchTodo={setQuery}
handleFiltered={setFilterParam}
/>

Choose a reason for hiding this comment

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

The TodoFilter component should reset the todos when the x button is clicked, as per the task requirements. Ensure that the x button not only clears the query but also resets the todos to their initial state.

Comment on lines +52 to +54
onClick={() => {
searchTodo('');
}}

Choose a reason for hiding this comment

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

The x button should not only clear the query but also reset the todos to their initial state. Ensure that the logic to reset the todos is implemented here, as this is a core requirement of the task.

@@ -15,15 +32,28 @@ export const TodoFilter = () => (
data-cy="searchInput"
type="text"
className="input"

Choose a reason for hiding this comment

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

Consider using the classnames library to manage conditional class names for the input field, as required by the checklist. This will help in managing class names more efficiently.

<tr
key={el.id}
data-cy="todo"
className={el.id === todo?.id ? 'has-background-info-light' : ''}

Choose a reason for hiding this comment

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

Consider using the classnames library to manage conditional class names for the row highlighting. This will help in managing class names more efficiently and is a requirement for this task.

Comment on lines +46 to +48
className={
el.completed ? ' has-text-success' : 'has-text-danger'
}

Choose a reason for hiding this comment

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

Consider using the classnames library to manage conditional class names for the text color based on the completion status. This will help in managing class names more efficiently and is a requirement for this task.

Comment on lines +68 to +70
<strong className="has-text-success">Done</strong>
) : (
<strong className="has-text-danger">Planned</strong>

Choose a reason for hiding this comment

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

Consider using the classnames library to manage conditional class names for the text color based on the completion status. This will help in managing class names more efficiently and is a requirement for this task.

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