From 34009d260029582d7745657cc7e1e5b7f450e065 Mon Sep 17 00:00:00 2001 From: Jieren Chen Date: Sun, 8 Sep 2024 13:07:01 -0400 Subject: [PATCH] checkpoint for currency and variant selection --- app/layout.tsx | 2 +- app/page.tsx | 8 +++++--- app/product/[handle]/page.tsx | 10 +++++++--- components/carousel.tsx | 9 ++++++--- components/grid/three-items.tsx | 13 ++++++++----- components/layout/navbar/index.tsx | 3 +++ lib/fourthwall/index.ts | 12 ++++++++---- lib/fourthwall/reshape.ts | 27 ++++++++++++++++++++++----- lib/fourthwall/types.ts | 18 +++++++++++------- 9 files changed, 71 insertions(+), 31 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index b793efe04..c4c4f9773 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -39,7 +39,7 @@ export const metadata = { export default async function RootLayout({ children }: { children: ReactNode }) { const cartId = cookies().get('cartId')?.value; // Don't await the fetch, pass the Promise to the context provider - const cart = getCart(cartId); + const cart = getCart(cartId, 'USD'); return ( diff --git a/app/page.tsx b/app/page.tsx index 7d407ede8..af275eab5 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -9,11 +9,13 @@ export const metadata = { } }; -export default function HomePage() { +export default function HomePage({ searchParams }: { searchParams: { currency?: string } }) { + const currency = searchParams.currency || 'USD'; + return ( <> - - + +