-
Notifications
You must be signed in to change notification settings - Fork 858
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 #772
base: master
Are you sure you want to change the base?
add task solution #772
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.
Thank you for your hard work on this pull request! 😊 There are a few critical issues that need to be addressed before we can approve it:
-
Filter on Spaces: The current implementation attempts to filter the list even when the input contains only spaces. Please update the code to prevent filtering in such cases.
-
Show All People on Focus: The task requires displaying all people when the input is focused but empty. This functionality is currently missing and needs to be implemented.
These issues impact the core functionality of the task, so it's important to address them. Once these are resolved, your code will be in great shape! Keep up the good work, and feel free 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.
@@ -1,74 +1,24 @@ | |||
import React from 'react'; | |||
import React, { useState } from 'react'; | |||
import './App.scss'; | |||
import { peopleFromServer } from './data/people'; |
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 peopleFromServer
import from './data/people' is correctly defined and used. Verify that this module exports the expected data.
import './App.scss'; | ||
import { peopleFromServer } from './data/people'; | ||
import Autocomplete from './components/Autocomplete'; | ||
import { Person } from './types/Person'; |
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 Person
type is correctly defined in './types/Person'. Verify that this type matches the expected structure used in the Autocomplete
component.
src/components/Autocomplete.tsx
Outdated
return () => clearTimeout(handler); | ||
}, [query, debounceDelay]); | ||
|
||
const filterePeople = useMemo(() => { |
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.
There is a typo in the variable name filterePeople
. It should be corrected to filteredPeople
for clarity and consistency.
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 addressing the issues from the previous review! 🎉 Your implementation now correctly handles cases where the input contains only spaces and shows all people when the input is focused but empty. This aligns with the task requirements and constraints.
While the App.tsx
file initially had some critical issues, you've successfully resolved them in the Autocomplete.tsx
file. Remember to ensure that the Autocomplete
component consistently displays all people when the input is focused but empty, and that filtering does not occur if the input contains only spaces.
These improvements are crucial for the functionality of your code. Keep up the good work, and make sure to address any critical issues in the future to avoid similar problems. This decision is made to help you move forward with your learning, so please review the comments to further improve your code. Keep learning and refining your skills! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<Autocomplete | ||
people={peopleFromServer} | ||
debounceDelay={300} | ||
onSelected={setSelectedPerson} | ||
/> |
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 Autocomplete
component displays all people when the input is focused but empty. This functionality is currently missing and is required as per the task description.
https://Svimpik.github.io/react_autocomplete/