From 9cab4ac2c6a7735535695b84fe62799e74ab669c Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Mon, 21 Aug 2023 12:03:05 +0200 Subject: [PATCH] Updates --- components/layout/header/header.tsx | 2 ++ components/modules/usp-section/usp-section.tsx | 4 +--- components/preview-provider.tsx | 16 ---------------- components/ui/card/card.tsx | 4 ++-- lib/sanity/sanity.types.ts | 8 +++++++- 5 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 components/preview-provider.tsx diff --git a/components/layout/header/header.tsx b/components/layout/header/header.tsx index 6c2f7b0a2..a9d160cb7 100644 --- a/components/layout/header/header.tsx +++ b/components/layout/header/header.tsx @@ -28,6 +28,7 @@ export default async function Header({ locale }: HeaderProps) {
}> + {/* @ts-ignore */}
@@ -44,6 +45,7 @@ export default async function Header({ locale }: HeaderProps) {
+ {/* @ts-ignore */}
diff --git a/components/modules/usp-section/usp-section.tsx b/components/modules/usp-section/usp-section.tsx index ef741301a..74d9cbb9e 100644 --- a/components/modules/usp-section/usp-section.tsx +++ b/components/modules/usp-section/usp-section.tsx @@ -1,5 +1,3 @@ -'use client'; - import SanityImage from '../../ui/sanity-image'; interface USPSectionProps { @@ -24,7 +22,7 @@ const USPSection = ({ usps }: USPSectionProps) => { alt={usp.name || 'USP image'} width={96} height={96} - sizes="96px" + size="96px" />
)} diff --git a/components/preview-provider.tsx b/components/preview-provider.tsx deleted file mode 100644 index 88065c20e..000000000 --- a/components/preview-provider.tsx +++ /dev/null @@ -1,16 +0,0 @@ -'use client'; - -import { getClient } from '@/lib/sanity/sanity.client'; -import { LiveQueryProvider } from '@sanity/preview-kit'; -import { useMemo } from 'react'; - -export default function PreviewProvider({ - children, - token -}: { - children: React.ReactNode; - token: string; -}) { - const client = useMemo(() => getClient({ token }), [token]); - return {children}; -} diff --git a/components/ui/card/card.tsx b/components/ui/card/card.tsx index bb7ea67a4..4d226079c 100644 --- a/components/ui/card/card.tsx +++ b/components/ui/card/card.tsx @@ -49,7 +49,7 @@ const Card: FC = ({ className, title, image, link, text, imageFormat className={imageClasses} image={image} alt={image.alt || ''} - sizes="(max-width: 1024px) 50vw, 90vw" + size="(max-width: 1024px) 50vw, 90vw" /> )} @@ -71,7 +71,7 @@ const Card: FC = ({ className, title, image, link, text, imageFormat className={imageClasses} image={image} alt={image.alt || ''} - sizes="(max-width: 1024px) 50vw, 20vw" + size="(max-width: 1024px) 50vw, 20vw" /> )} diff --git a/lib/sanity/sanity.types.ts b/lib/sanity/sanity.types.ts index d692148f0..2657fe54e 100644 --- a/lib/sanity/sanity.types.ts +++ b/lib/sanity/sanity.types.ts @@ -1,5 +1,11 @@ import type { Image } from 'sanity' +export interface MenuItem { + _type: string + slug?: string + title?: string +} + export interface HomePagePayload { content?: [] title?: string @@ -63,5 +69,5 @@ export interface SearchPayload { export interface MainMenuPayload { title?: string _type?: string - items: [] + items?: MenuItem[] } \ No newline at end of file