diff --git a/src/app/[country]/[locale]/(checkout)/layout.tsx b/src/app/[country]/[locale]/(checkout)/layout.tsx index f9b85ab0..35c227d6 100644 --- a/src/app/[country]/[locale]/(checkout)/layout.tsx +++ b/src/app/[country]/[locale]/(checkout)/layout.tsx @@ -6,7 +6,11 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; import { useTranslations } from "next-intl"; import { useState } from "react"; -import { CheckoutProvider, CheckoutSummary } from "@/contexts/CheckoutContext"; +import { + CheckoutProvider, + CheckoutSummary, + useCheckout, +} from "@/contexts/CheckoutContext"; import { POLICY_LINKS } from "@/lib/constants/policies"; import { getStoreName } from "@/lib/store"; import { extractBasePath } from "@/lib/utils/path"; @@ -19,7 +23,7 @@ function CheckoutHeader() { const t = useTranslations("checkoutLayout"); return ( -
+
); @@ -70,6 +74,12 @@ function CheckoutFooter() { function MobileSummaryToggle() { const [isOpen, setIsOpen] = useState(false); const t = useTranslations("checkoutLayout"); + const { summaryContent } = useCheckout(); + + // Hide the toggle entirely when there's no summary to show (e.g. the + // order-placed page clears summaryContent because the page already + // displays the order details inline). + if (summaryContent === null) return null; return (
diff --git a/src/components/cart/CartDrawer.tsx b/src/components/cart/CartDrawer.tsx index e8d3a420..f5904de4 100644 --- a/src/components/cart/CartDrawer.tsx +++ b/src/components/cart/CartDrawer.tsx @@ -88,7 +88,7 @@ export function CartDrawer() { >