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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const PRODUCT_OWNER_SELECT = {
} satisfies Prisma.ProductSelect;

const PRODUCT_PUBLIC_SELECT = {
id: true,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
productCode: true,
name: true,
title: true,
Expand Down Expand Up @@ -277,6 +278,7 @@ export interface OwnerProductResponse {
}

export interface PublicProductResponse {
productId: string;
productCode: string | null;
name: string;
title: string | null;
Expand Down Expand Up @@ -1355,6 +1357,7 @@ export class ProductService {
product: PublicProductRecord,
): PublicProductResponse {
return {
productId: product.id,
productCode: product.productCode,
name: product.name,
title: product.title,
Expand Down
9 changes: 7 additions & 2 deletions apps/web/src/app/(public)/p/[code]/ProductDetailClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState, useMemo } from "react";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
import {
ChevronLeft,
ChevronRight,
Expand Down Expand Up @@ -208,6 +209,7 @@ interface ProductDetailClientProps {

export function ProductDetailClient({ product }: ProductDetailClientProps) {
const { toast } = useToast();
const router = useRouter();

// ── Variant state ──────────────────────────────────────────────────────────
const uniqueColors = useMemo(
Expand Down Expand Up @@ -316,8 +318,11 @@ export function ProductDetailClient({ product }: ProductDetailClientProps) {

function handleBuyNow() {
if (!validateVariantAndProceed()) return;
// Checkout is not available in W-06 — coming in W-09a
toast("Checkout coming soon", { variant: "default" });
const params = new URLSearchParams();
if (product.productCode) params.set("code", product.productCode);
if (selectedVariant?.id) params.set("variantId", selectedVariant.id);
const qs = params.toString();
router.push(`/buyer/checkout/${product.productId}${qs ? `?${qs}` : ""}`);
}

// ── Render ─────────────────────────────────────────────────────────────────
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/app/(public)/p/[code]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface ProductDetail {
}

export interface PublicProduct {
productId: string;
productCode: string | null;
name: string;
title: string | null;
Expand Down
19 changes: 19 additions & 0 deletions apps/web/src/app/(shopper)/buyer/_components/ShopperShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,28 @@ interface ShopperShellProps {
children: ReactNode;
}

// Routes inside /buyer/* that should render without the 3-column social shell.
// Checkout is the only focus-mode route in MVP — see TWIZRR_WEB_TASKS W-09a
// and apps/web/AGENTS.md ("checkout/[productId]/page.tsx ← focus mode").
const STANDALONE_ROUTE_PREFIXES = ["/buyer/checkout"];

function isStandaloneRoute(pathname: string): boolean {
return STANDALONE_ROUTE_PREFIXES.some(
(prefix) => pathname === prefix || pathname.startsWith(prefix + "/"),
);
}

export function ShopperShell({ children }: ShopperShellProps) {
const pathname = usePathname();

if (isStandaloneRoute(pathname)) {
return (
<div className="min-h-screen bg-[var(--color-bianca)] text-[var(--color-espresso)]">
{children}
</div>
);
}

return (
<AppShell
mode="SHOPPING"
Expand Down
Loading
Loading