diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 9e381b16f..5e3f0d437 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -39,7 +39,7 @@ export default async function HomePage({ } return ( -
+
diff --git a/app/[locale]/product/[handle]/layout.tsx b/app/[locale]/product/[handle]/layout.tsx new file mode 100644 index 000000000..14ddd776c --- /dev/null +++ b/app/[locale]/product/[handle]/layout.tsx @@ -0,0 +1,43 @@ +import Footer from 'components/layout/footer'; +import { SupportedLocale } from 'components/layout/navbar/language-control'; + +import Navbar from 'components/layout/navbar'; +import { getCart } from 'lib/shopify'; +import { cookies } from 'next/headers'; +import { ReactNode, Suspense } from 'react'; + +export const runtime = 'edge'; +const { SITE_NAME } = process.env; + +export const metadata = { + title: SITE_NAME, + description: SITE_NAME, + openGraph: { + type: 'website' + } +}; + +export default async function ProductLayout({ + params: { locale }, + children +}: { + params: { locale?: SupportedLocale }; + children: ReactNode[] | ReactNode | string; +}) { + const cartId = cookies().get('cartId')?.value; + let cart; + + if (cartId) { + cart = await getCart(cartId); + } + + return ( +
+ + {children} + +
+ +
+ ); +} diff --git a/app/[locale]/product/[handle]/page.tsx b/app/[locale]/product/[handle]/page.tsx index c1a3cca64..7352a52e9 100644 --- a/app/[locale]/product/[handle]/page.tsx +++ b/app/[locale]/product/[handle]/page.tsx @@ -3,7 +3,6 @@ import { notFound } from 'next/navigation'; import { Suspense } from 'react'; import { GridTileImage } from 'components/grid/tile'; -import Footer from 'components/layout/footer'; import { Gallery } from 'components/product/gallery'; import { ProductDescription } from 'components/product/product-description'; import { HIDDEN_PRODUCT_TAG } from 'lib/constants'; @@ -81,8 +80,8 @@ export default async function ProductPage({ params }: { params: { handle: string __html: JSON.stringify(productJsonLd) }} /> -
-
+
+
({ @@ -100,9 +99,6 @@ export default async function ProductPage({ params }: { params: { handle: string
- -