Add client-side Search Results page + Filters - #1
Open
Doguserkivac09 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added new SearchResults page at src/pages/SearchResults.jsx which reads /search?q=... and uses useFetchListings() to fetch listings and apply client-side filtering, sorting, and pagination.
Added SearchFilters component at src/components/SearchFilters.jsx for category, rating, price, tags and sorting controls.
Updated useFetchListings hook (src/hooks/useFetchListings.js) to accept an optional category parameter: if omitted the hook returns all listings — this enables the search page to fetch everything and filter client-side.
Added route /search to App.jsx for the new SearchResults page. How to test:
Run the app locally (npm start / yarn start).
Visit /search?q=restoran or use navbar search.
Try filters, sorting, pagination, and verify ListingCard displays. Notes:
This is client-side filtering. If you have a server-side search API available, we can switch SearchResults to call it (better for large datasets).
Files changed: src/pages/SearchResults.jsx, src/components/SearchFilters.jsx, src/hooks/useFetchListings.js, src/App.jsx