This commit is contained in:
Henrik Larsson 2023-08-21 12:03:05 +02:00
parent 21f4893b70
commit 9cab4ac2c6
5 changed files with 12 additions and 22 deletions

View File

@ -28,6 +28,7 @@ export default async function Header({ locale }: HeaderProps) {
<div className="relative flex w-full items-center justify-between px-4 py-2 lg:px-8 2xl:px-16">
<div className="-translate-x-2 transform md:hidden">
<Suspense fallback={<OpenMobileMenu />}>
{/* @ts-ignore */}
<MobileMenuModal items={mainMenu} />
</Suspense>
</div>
@ -44,6 +45,7 @@ export default async function Header({ locale }: HeaderProps) {
<div className="absolute left-1/2 top-1/2 hidden -translate-x-1/2 -translate-y-1/2 transform md:flex">
<Suspense>
{/* @ts-ignore */}
<DesktopMenu items={mainMenu} />
</Suspense>
</div>

View File

@ -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"
/>
</div>
)}

View File

@ -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 <LiveQueryProvider client={client}>{children}</LiveQueryProvider>;
}

View File

@ -49,7 +49,7 @@ const Card: FC<CardProps> = ({ 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"
/>
</div>
)}
@ -71,7 +71,7 @@ const Card: FC<CardProps> = ({ 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"
/>
</div>
)}

View File

@ -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[]
}