mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 16:07:01 +00:00
Updates
This commit is contained in:
parent
21f4893b70
commit
9cab4ac2c6
@ -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>
|
||||
|
@ -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>
|
||||
)}
|
||||
|
@ -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>;
|
||||
}
|
@ -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>
|
||||
)}
|
||||
|
@ -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[]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user