Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/app/[country]/[locale]/(checkout)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -19,7 +23,7 @@ function CheckoutHeader() {
const t = useTranslations("checkoutLayout");

return (
<header className="flex items-center justify-between">
<header className="flex items-center justify-between h-16">
<Link href={basePath || "/"} className="flex items-center space-x-2">
<Image
src="/spree.png"
Expand All @@ -36,7 +40,7 @@ function CheckoutHeader() {
aria-label={t("backToStore")}
>
<ArrowLeft className="w-4 h-4" aria-hidden="true" />
<span className="hidden sm:inline">{t("backToStore")}</span>
{t("backToStore")}
</Link>
</header>
);
Expand Down Expand Up @@ -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 (
<div className="lg:hidden border-b border-gray-200 bg-gray-50">
Expand Down
2 changes: 1 addition & 1 deletion src/components/cart/CartDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function CartDrawer() {
>
<SheetContent
side="right"
className="w-full max-w-md flex flex-col p-0 gap-0"
className="data-[side=right]:w-full data-[side=right]:sm:max-w-md flex flex-col p-0 gap-0"
showCloseButton={false}
aria-describedby={undefined}
>
Expand Down
Loading