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
-
-
-
>
);
}
@@ -110,18 +106,20 @@ export default async function ProductPage({ params }: { params: { handle: string
async function RelatedProducts({ id }: { id: string }) {
const relatedProducts = await getProductRecommendations({ productId: id });
+ console.debug({ relatedProducts });
+
if (!relatedProducts.length) return null;
return (
-
-
Related Products
+
+
Related Products
{relatedProducts.map((product) => (
-
-
+
+
diff --git a/components/cart/add-to-cart.tsx b/components/cart/add-to-cart.tsx
index f9d21c0fd..e49cf822e 100644
--- a/components/cart/add-to-cart.tsx
+++ b/components/cart/add-to-cart.tsx
@@ -52,7 +52,7 @@ export function AddToCart({
});
}}
className={clsx(
- 'relative flex w-full items-center justify-center rounded-full bg-blue-600 p-4 tracking-wide text-white hover:opacity-90',
+ 'relative flex w-full items-center justify-center rounded-md bg-white/20 p-4 font-sans tracking-wide text-white hover:opacity-90',
{
'cursor-not-allowed opacity-60 hover:opacity-60': !availableForSale || !selectedVariantId,
'cursor-not-allowed': isPending
diff --git a/components/cart/close-cart.tsx b/components/cart/close-cart.tsx
index 515b94843..90683a9c5 100644
--- a/components/cart/close-cart.tsx
+++ b/components/cart/close-cart.tsx
@@ -3,7 +3,7 @@ import clsx from 'clsx';
export default function CloseCart({ className }: { className?: string }) {
return (
-
+
);
diff --git a/components/cart/modal.tsx b/components/cart/modal.tsx
index 4fbfcc6ad..1c52d5cb5 100644
--- a/components/cart/modal.tsx
+++ b/components/cart/modal.tsx
@@ -64,7 +64,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
leaveFrom="translate-x-0"
leaveTo="translate-x-full"
>
-
+
My Cart
@@ -96,10 +96,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
);
return (
-
-
+
-
@@ -109,7 +106,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
onClick={closeCart}
className="z-30 flex flex-row space-x-4"
>
-
+
{item.merchandise.title !== DEFAULT_OPTION ? (
-
- {item.merchandise.title}
-
+ {item.merchandise.title}
) : null}
@@ -139,7 +134,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
amount={item.cost.totalAmount.amount}
currencyCode={item.cost.totalAmount.currencyCode}
/>
-
+
{item.quantity}
@@ -153,22 +148,22 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
})}
-
+
-
+
Shipping
-
Calculated at checkout
+
Calculated at checkout
-
+
Total
diff --git a/components/cart/open-cart.tsx b/components/cart/open-cart.tsx
index 905b853f8..0faa62b2e 100644
--- a/components/cart/open-cart.tsx
+++ b/components/cart/open-cart.tsx
@@ -19,7 +19,7 @@ export default function OpenCart({
/>
{quantity ? (
-
+
{quantity}
) : null}
diff --git a/components/layout/footer.tsx b/components/layout/footer.tsx
index 0819292ea..116873c8b 100644
--- a/components/layout/footer.tsx
+++ b/components/layout/footer.tsx
@@ -29,7 +29,9 @@ export default async function Footer({ cart }: { cart?: Cart }) {
-
+
+
+
杉の森酒造
@@ -45,7 +47,9 @@ export default async function Footer({ cart }: { cart?: Cart }) {
-
+
+
+
杉の森酒造
diff --git a/components/layout/navbar/index.tsx b/components/layout/navbar/index.tsx
index 99d239edd..b436a4206 100644
--- a/components/layout/navbar/index.tsx
+++ b/components/layout/navbar/index.tsx
@@ -32,7 +32,7 @@ export default function Navbar({ cart, locale }: { cart?: Cart; locale?: Support
>
-
+
@@ -51,7 +51,7 @@ export default function Navbar({ cart, locale }: { cart?: Cart; locale?: Support
className={clsx('mx-auto flex max-w-screen-xl flex-row items-start justify-between px-6')}
>
-
+
{images[imageIndex] && (
1 ? (
-
-
+
+
-
+
+
-
diff --git a/components/product/product-description.tsx b/components/product/product-description.tsx
index a81a6b02c..471bf5a36 100644
--- a/components/product/product-description.tsx
+++ b/components/product/product-description.tsx
@@ -7,9 +7,9 @@ import { VariantSelector } from './variant-selector';
export function ProductDescription({ product }: { product: Product }) {
return (
<>
-