-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #2744
base: master
Are you sure you want to change the base?
add task solution #2744
Conversation
There was a problem hiding this 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 task requirements! 🎉 The code is well-structured and meets the core functionality as expected. While there are minor improvements suggested, such as ensuring the Loader
is displayed correctly during data fetching and explicitly handling the 'all' filter case, these do not significantly impact the overall functionality. Keep up the good work and consider these suggestions for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
switch (filter) { | ||
case 'active': | ||
result = allTodos.filter(todo => !todo.completed); | ||
break; | ||
|
||
case 'completed': | ||
result = allTodos.filter(todo => todo.completed); | ||
break; | ||
|
||
default: | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter
switch statement should include a case for 'all' to ensure that all todos are displayed when this filter is selected. Currently, the default case does not handle this explicitly, which might lead to unexpected behavior.
<Loader /> | ||
<TodoList /> | ||
</div> | ||
{loader ? <Loader /> : <TodoList todos={filteredTodos} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the Loader
component is displayed correctly while data is being fetched. According to the task description, the Loader should be shown when waiting for any data from the server.
DEMO LINK