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

Search bar fix #9

Open
akshat-bhansali opened this issue Mar 14, 2024 · 6 comments
Open

Search bar fix #9

akshat-bhansali opened this issue Mar 14, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request very hard

Comments

@akshat-bhansali
Copy link
Contributor

akshat-bhansali commented Mar 14, 2024

The navbar has a search bar present in it.
You have to make a list of users(first 5) appear according to the search.
Example :- If I type "AK" then the list should Akshit-Nandan and Akshat-Bhansali in it.
List format is icon on left and name following it.
On clicking on any user, it should be directed to their profile(Example - /profile/Akshit-Nandan ....check the route in the hackathon participant section for reference)
The list of all users is present in the "listUser" useState variable in the navbar file

@akshat-bhansali akshat-bhansali added enhancement New feature or request hard very hard and removed hard labels Mar 14, 2024
@0PrashantYadav0
Copy link

@akshat-bhansali
i would like to work on this issue. Also i want to ask that do we need to add search button for searching or it will be based on input??

@akshat-bhansali
Copy link
Contributor Author

@0PrashantYadav0
whenever the input text changes,show the top 5 results from the list stored in one of the usestate variables in navbar component.
The variable is already being logged every time the input changes since it is in the dependency array of the use state.You just have to manipulate the data.
Also,please explain me your approach

@0PrashantYadav0
Copy link

@akshat-bhansali i will take input in search bar and match the input from user list present in navbar using startsWith() function

@akshat-bhansali
Copy link
Contributor Author

It is not to be checked with just the starting…The text can be any part of it.Basically it is REGEX
Let me know your approach so that I can assign you the issue

@0PrashantYadav0
Copy link

0PrashantYadav0 commented Mar 15, 2024

Ohk then i will use includes() function to search for pattern and sort the array so that i will give the closest result

@akshat-bhansali
Copy link
Contributor Author

@0PrashantYadav0 I have assigned you the issue.All the best!

This was referenced Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request very hard
Projects
None yet
Development

No branches or pull requests

2 participants