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 #772

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

add task solution #772

wants to merge 2 commits into from

Conversation

Svimpik
Copy link

@Svimpik Svimpik commented Nov 8, 2024

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 pull request! 😊 There are a few critical issues that need to be addressed before we can approve it:

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

  2. 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';

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';

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.

return () => clearTimeout(handler);
}, [query, debounceDelay]);

const filterePeople = useMemo(() => {

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.

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

Comment on lines +12 to +16
<Autocomplete
people={peopleFromServer}
debounceDelay={300}
onSelected={setSelectedPerson}
/>

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.

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