From 047e5fe566fe709db9ae01b5b5a0ab05669d8ebf Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Tue, 8 Aug 2023 17:06:04 +0200 Subject: [PATCH] Updates --- ...[[...slug]]/product-page.tsx | 14 +- app/[locale]/layout.tsx | 2 + app/api/draft/route.ts | 4 +- components/cart/modal.tsx | 12 +- components/layout/footer/footer.tsx | 6 +- components/layout/header/desktop-menu.tsx | 33 +++ components/layout/header/header.tsx | 12 +- components/ui/product-card/product-card.tsx | 4 +- components/ui/sanity-image/sanity-image.tsx | 42 ++-- components/ui/text/text.tsx | 2 +- lib/sanity/queries.tsx | 10 +- lib/sanity/sanity.client.ts | 2 +- messages/en.json | 5 +- messages/sv.json | 5 +- package.json | 4 +- pnpm-lock.yaml | 226 ++++++++++---------- 16 files changed, 214 insertions(+), 169 deletions(-) create mode 100644 components/layout/header/desktop-menu.tsx diff --git a/...[[...slug]]/product-page.tsx b/...[[...slug]]/product-page.tsx index 1e1e69d71..49d34df0b 100644 --- a/...[[...slug]]/product-page.tsx +++ b/...[[...slug]]/product-page.tsx @@ -1,21 +1,19 @@ -import ProductView from "components/product/product-view"; -import { notFound } from "next/navigation"; +import ProductView from 'components/product/product-view'; +import { notFound } from 'next/navigation'; interface ProductPageProps { - data: object | any + data: object | any; } // This is a Client Component. It receives data as props and // has access to state and effects just like Page components // in the `pages` directory. -export default function ProductPage({data }: ProductPageProps) { +export default function ProductPage({ data }: ProductPageProps) { if (!data) { return notFound(); } - + const { product } = data; - return ( - - ) + return ; } diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 0546880c4..bdf536ca2 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -59,6 +59,8 @@ export default async function LocaleLayout({ children, params: { locale } }: Loc
{children}
+ {/* @ts-expect-error Server Component */} + {/* https://github.com/vercel/next.js/issues/42292 */}