From b077423ab259304d326cea3718e8c320f71b34e7 Mon Sep 17 00:00:00 2001 From: devops Date: Sun, 18 Oct 2026 14:09:01 +0000 Subject: [PATCH] fix: move BackToTop to right side, wire global prescription modal trigger in header & mobile drawer --- frontend/application/app/ClientLayout.tsx | 11 ++++------- frontend/application/components/Footer.tsx | 12 +++++++++--- frontend/application/components/Header.tsx | 3 ++- .../application/components/MobileBottomNav.tsx | 14 ++++++++++++++ frontend/application/lib/store/uiStore.ts | 4 ++++ 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/frontend/application/app/ClientLayout.tsx b/frontend/application/app/ClientLayout.tsx index 5d8fa079..d5f8d746 100644 --- a/frontend/application/app/ClientLayout.tsx +++ b/frontend/application/app/ClientLayout.tsx @@ -38,7 +38,8 @@ export default function ClientLayout({ children }: { children: React.ReactNode } const setLoginModalOpen = useUIStore((state) => state.setLoginModalOpen); const setB2BPortalOpen = useUIStore((state) => state.setB2BPortalOpen); const clearAdvisorData = useUIStore((state) => state.clearAdvisorData); - const [isPrescriptionModalOpen, setIsPrescriptionModalOpen] = useState(false); + const isPrescriptionModalOpen = useUIStore((state) => state.isPrescriptionModalOpen); + const setPrescriptionModalOpen = useUIStore((state) => state.setPrescriptionModalOpen); const pathname = usePathname(); const router = useRouter(); @@ -230,15 +231,11 @@ export default function ClientLayout({ children }: { children: React.ReactNode } />} setIsPrescriptionModalOpen(false)} + onClose={() => setPrescriptionModalOpen(false)} /> { - if (!isLoggedIn) { - setAuthModalOpen(true); - } else { - setIsPrescriptionModalOpen(true); - } + setPrescriptionModalOpen(true); }} /> diff --git a/frontend/application/components/Footer.tsx b/frontend/application/components/Footer.tsx index ec0b9dfb..89c33fec 100644 --- a/frontend/application/components/Footer.tsx +++ b/frontend/application/components/Footer.tsx @@ -1,5 +1,6 @@ "use client"; import React, { useState, useEffect } from "react"; +import { usePathname } from "next/navigation"; import Image from "next/image"; import { Phone, Mail, MapPin, Instagram, ShieldCheck, Globe, ArrowUp, Download, ChevronDown, ChevronUp } from "lucide-react"; import { useSettingsStore } from "../lib/store/settingsStore"; @@ -8,7 +9,9 @@ import Link from "next/link"; import { NavigationTarget } from "../lib/types"; -export default function Footer({ +export default function Footer({ + // Footer hooks + onB2BOpen }: { onNavigate?: (v: NavigationTarget) => void; @@ -17,6 +20,8 @@ export default function Footer({ }) { const getText = useSettingsStore(state => state.getText); const isB2BEnabled = useSettingsStore((s) => s.getBoolean('b2bRegistrationOpen', true) && s.getBoolean('b2b_enabled', true)); + const pathname = usePathname(); + const isPdpPage = pathname?.startsWith('/shop/') && pathname !== '/shop'; const [showScroll, setShowScroll] = useState(false); const [footerCol1, setFooterCol1] = useState>([]); const [isDescExpanded, setIsDescExpanded] = useState(false); @@ -53,12 +58,13 @@ export default function Footer({ return (