feat: Enhance Hotels Route with City Query Parameter Support #47
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
react
Description:
Issue Summary:
Currently, the application supports navigating to the
/hotels
route with a city specified through internal state management, such as when a user searches for "Pune" from the homepage. However, this approach does not update the URL with the search parameters, limiting direct URL navigation and bookmarking capabilities. To improve usability and direct access, we aim to introduce support for URL query parameters, specifically for city selection.Objective:
Enable the
/hotels
route to accept acity
query parameter in the URL, allowing users to directly navigate to a pre-filtered list of hotels based on the city. This feature should support both direct URL entry (e.g.,/hotels?city=pune
) and navigation from within the application, enhancing flexibility and user experience.Implementation Steps:
Query Parameter Support:
city
query parameter from the URL. This involves checking the URL for anycity
parameters upon route loading.Prioritize Query Parameter:
/hotels
route to first check for acity
query parameter. If present, use this parameter as thelocationInputValue
to filter the hotel listings.city
query parameter is not present, then fallback to using the existing state variable (locationInputValue
) as the source for the city filter.The text was updated successfully, but these errors were encountered: