From 529b05ea1e0fc3b6b34e31906b559b52b8d777c1 Mon Sep 17 00:00:00 2001 From: priyanshuvish Date: Thu, 16 Oct 2025 13:32:47 +0530 Subject: [PATCH] explore card error solved --- src/components/Navbar.tsx | 20 ++++++-------------- src/components/SubNavbar.tsx | 33 ++++++++++++++------------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 9411000..c3d1c40 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -341,20 +341,12 @@ export default function Navbar({
{/* Explore Card - First Item - No Dropdown */} - setActiveExploreCardDropdown(!activeExploreCardDropdown)} - items={exploreCardItems} - title="Explore Card" - className='px-0' - trigger={ -
- Explore Card - -
- } - /> + + Explore Card + {/* Other Navigation Items */} {navigationItems.map((item) => ( diff --git a/src/components/SubNavbar.tsx b/src/components/SubNavbar.tsx index 2b7c93b..e1cd761 100644 --- a/src/components/SubNavbar.tsx +++ b/src/components/SubNavbar.tsx @@ -1,61 +1,56 @@ + import { motion } from 'motion/react'; +import { useNavigate } from 'react-router-dom'; interface SubNavbarProps { activePage?: 'citycards' | 'magic-itinerary' | 'postcards' | 'offers' | 'esims' | 'hotel-discounts'; activeTab?: 'citycards' | 'magic-itinerary' | 'postcards' | 'offers' | 'esims' | 'hotel-discounts'; - onCityCardsClick: () => void; - onMagicItineraryClick: () => void; - onPostCardsClick: () => void; - onOffersClick: () => void; - onEsimsClick: () => void; - onHotelDiscountsClick: () => void; } export function SubNavbar({ activeTab, activePage, - onCityCardsClick, - onMagicItineraryClick, - onPostCardsClick, - onOffersClick, - onEsimsClick, - onHotelDiscountsClick }: SubNavbarProps) { + const navigate = useNavigate(); const activeProduct = activePage || activeTab; const products = [ { id: 'citycards', label: 'CityCards', - onClick: onCityCardsClick + path: '/citycards' }, { id: 'magic-itinerary', label: 'Magic Itinerary', - onClick: onMagicItineraryClick + path: '/magic-itinerary' }, { id: 'postcards', label: 'PostCards', - onClick: onPostCardsClick + path: '/postcards' }, { id: 'offers', label: 'Offers', - onClick: onOffersClick + path: '/offers' }, { id: 'esims', label: 'eSIMs', - onClick: onEsimsClick + path: '/esims' }, { id: 'hotel-discounts', label: 'Hotel Discounts', - onClick: onHotelDiscountsClick + path: '/hotel-discounts' } ]; + const handleProductClick = (path: string) => { + navigate(path); + }; + return ( ( handleProductClick(product.path)} className={`font-poppins font-medium text-base relative px-4 py-2.5 transition-all duration-300 whitespace-nowrap rounded-full ${ activeProduct === product.id ? 'bg-primary text-white shadow-md'