This commit is contained in:
1 parent
d73b2e51c6
commit
5afa2a37be
5 files changed
+24
-19
No files matched your search
@@ -39,9 +39,10 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
const setB2BPortalOpen = useUIStore((state) => state.setB2BPortalOpen);
|
||||
const clearAdvisorData = useUIStore((state) => state.clearAdvisorData);
|
||||
const [isPrescriptionModalOpen, setIsPrescriptionModalOpen] = useState(false);
|
||||
|
||||
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
const isUtilityRoute = pathname === "/login" || pathname === "/cart";
|
||||
|
||||
const fetchProfile = useUserStore((state) => state.fetchProfile);
|
||||
const role = useUserStore((state) => state.role);
|
||||
@@ -166,9 +167,9 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
<>
|
||||
<NavigationProgressBar />
|
||||
<NetworkBanner />
|
||||
<Header
|
||||
onNavigate={handleNavigate}
|
||||
onShopNavigate={navigateToShop}
|
||||
<Header
|
||||
onNavigate={handleNavigate}
|
||||
onShopNavigate={navigateToShop}
|
||||
currentView={currentView}
|
||||
onCartOpen={() => setCartOpen(true)}
|
||||
onSearch={handleSearch}
|
||||
@@ -177,23 +178,23 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
<main className={`min-h-screen ${pathname === '/catalog' ? 'bg-slate-950' : ''}`}>
|
||||
{children}
|
||||
</main>
|
||||
<Footer onNavigate={handleNavigate} onShopNavigate={navigateToShop} onB2BOpen={() => setB2BPortalOpen(true)} />
|
||||
|
||||
{!isUtilityRoute && <Footer onNavigate={handleNavigate} onShopNavigate={navigateToShop} onB2BOpen={() => setB2BPortalOpen(true)} />}
|
||||
|
||||
{isB2BPortalOpen && isB2BEnabled && (
|
||||
<B2BPortal onClose={() => setB2BPortalOpen(false)} />
|
||||
)}
|
||||
<CartDrawer
|
||||
isOpen={isCartOpen}
|
||||
onClose={() => setCartOpen(false)}
|
||||
onCheckout={() => { setCartOpen(false); router.push('/checkout'); }}
|
||||
{!isUtilityRoute && <CartDrawer
|
||||
isOpen={isCartOpen}
|
||||
onClose={() => setCartOpen(false)}
|
||||
onCheckout={() => { setCartOpen(false); router.push('/checkout'); }}
|
||||
onShopNavigate={navigateToShop}
|
||||
/>
|
||||
<LoginModal
|
||||
isOpen={isLoginModalOpen}
|
||||
/>}
|
||||
<LoginModal
|
||||
isOpen={isLoginModalOpen}
|
||||
onClose={() => {
|
||||
setLoginModalOpen(false);
|
||||
clearAdvisorData();
|
||||
}}
|
||||
}}
|
||||
onLogin={async () => {
|
||||
setLoginModalOpen(false);
|
||||
if (advisorData) {
|
||||
@@ -219,14 +220,14 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
console.error("Auto pet registration after login failed:", e);
|
||||
}
|
||||
}
|
||||
}}
|
||||
}}
|
||||
petName={advisorData?.name as string | undefined}
|
||||
isAdvisorContext={!!advisorData}
|
||||
/>
|
||||
<AuthModal
|
||||
{!isUtilityRoute && <AuthModal
|
||||
isOpen={isAuthModalOpen}
|
||||
onClose={() => setAuthModalOpen(false)}
|
||||
/>
|
||||
/>}
|
||||
<PrescriptionUploadModal
|
||||
isOpen={isPrescriptionModalOpen}
|
||||
onClose={() => setIsPrescriptionModalOpen(false)}
|
||||
|
||||
Reference in new issue
Block a user