boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

Implementing filtering of search results #192

Closed Dex491 closed 1 year ago

Dex491 commented 1 year ago

Implementation of filtering search results:

Within Header.js:

Within SearchResults.js

dogezen commented 1 year ago

Use this example to implement the search parameters and reading of query parameters from the url: https://reactgo.com/react-router-query-params/

I think I am unclear fully about the flow:

1) the search bar is in

component, so the state for what the user types in search bar should be in this component. 2) once the user submits the search, then you redirect to the /search/query=... page, which will be the <SearchResults> component; here is where you then unpackage the query and submit the useEffect to fetch data and then apply the filters on the retrieved data.

dogezen commented 1 year ago

Hence, please break down the text above into some headings: each heading is the where that code / action is implemented. I think this will help.

Also not clear in which folder I should create the SearchResults component.

Joelzor commented 1 year ago

In terms of this comment, we create a folder called 'search' and the SearchResults component will sit inside of there

  • this will be done in issue #190, we just updated it to make this more clear