From 8abd56fe4e5ba0247190b1599ad32e41c4fb5f93 Mon Sep 17 00:00:00 2001 From: priyanshuvish Date: Fri, 17 Oct 2025 18:50:54 +0530 Subject: [PATCH] fix select city --- src/components/Navbar.tsx | 63 ++++++++++++++++++------------------ src/pages/ComingSoonPage.tsx | 2 +- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 0049cdb..387f9c2 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -327,7 +327,7 @@ export default function Navbar({
{/* Navigation Items based on page type */} {navigationItems.map((item) => ( @@ -365,7 +365,7 @@ export default function Navbar({ /> ))} - +
{/* Right Section */} @@ -373,36 +373,35 @@ export default function Navbar({ {/* City Dropdown */} { - console.log('City dropdown toggled'); - // Add a small delay to prevent rapid state changes - setTimeout(() => { - setActiveCityDropdown(!activeCityDropdown); - }, 50); - }} - items={cities.map(city => ({ - id: 'city-change', - label: city.label, - action: () => { - console.log('City action called:', city.id); - handleCityChange(city.id); - } - }))} - title="Select City" - trigger={ -
- - {isLandingPage - ? 'Select City' - : activeCity.charAt(0).toUpperCase() + activeCity.slice(1) - } - - -
- } - /> + ref={cityRef} + isOpen={activeCityDropdown} + onToggle={() => { + console.log('City dropdown toggled'); + setTimeout(() => { + setActiveCityDropdown(!activeCityDropdown); + }, 50); + }} + items={cities.map(city => ({ + id: 'city-change', + label: city.label, + action: () => { + console.log('City action called:', city.id); + handleCityChange(city.id); + } + }))} + title="Select City" + trigger={ +
+ + {isLandingPage || activeCity === 'Landingpage' || !activeCity + ? 'Select City' + : activeCity.charAt(0).toUpperCase() + activeCity.slice(1) + } + + +
+ } +/> {/* Language Dropdown */} = ({ return (