Skip to content

Add client-side Search Results page + Filters - #1

Open
Doguserkivac09 wants to merge 1 commit into
mainfrom
feature/search-filters
Open

Add client-side Search Results page + Filters#1
Doguserkivac09 wants to merge 1 commit into
mainfrom
feature/search-filters

Conversation

@Doguserkivac09

Copy link
Copy Markdown
Owner

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

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.

1 participant