mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
Prettier
This commit is contained in:
parent
f0105f9f59
commit
958e8a5b62
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
export default function Error({ reset }: { reset: () => void }) {
|
export default function Error({ reset }: { reset: () => void }) {
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto my-4 flex max-w-xl flex-col rounded-lg border border-neutral-200 bg-white p-8 dark:border-neutral-800 dark:bg-black md:p-12">
|
<div className="mx-auto my-4 flex max-w-xl flex-col rounded-lg border border-neutral-200 bg-white p-8 md:p-12 dark:border-neutral-800 dark:bg-black">
|
||||||
<h2 className="text-xl font-bold">Oh no!</h2>
|
<h2 className="text-xl font-bold">Oh no!</h2>
|
||||||
<p className="my-2">
|
<p className="my-2">
|
||||||
There was an issue with our storefront. This could be a temporary issue, please try your
|
There was an issue with our storefront. This could be a temporary issue, please try your
|
||||||
|
@ -82,9 +82,9 @@ export default async function ProductPage({ params }: { params: { handle: string
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className="mx-auto max-w-screen-2xl px-4">
|
<div className="mx-auto max-w-screen-2xl px-4">
|
||||||
<div className="flex flex-col rounded-lg border border-neutral-200 bg-white p-8 dark:border-neutral-800 dark:bg-black md:p-12 lg:flex-row lg:gap-8">
|
<div className="flex flex-col rounded-lg border border-neutral-200 bg-white p-8 md:p-12 lg:flex-row lg:gap-8 dark:border-neutral-800 dark:bg-black">
|
||||||
<div className="h-full w-full basis-full lg:basis-4/6">
|
<div className="h-full w-full basis-full lg:basis-4/6">
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
<div className="relative aspect-square h-full max-h-[550px] w-full overflow-hidden" />
|
<div className="relative aspect-square h-full max-h-[550px] w-full overflow-hidden" />
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import { Suspense } from 'react';
|
|||||||
export default function SearchLayout({ children }: { children: React.ReactNode }) {
|
export default function SearchLayout({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<div className="mx-auto flex max-w-screen-2xl flex-col gap-8 px-4 pb-4 text-black dark:text-white md:flex-row">
|
<div className="mx-auto flex max-w-screen-2xl flex-col gap-8 px-4 pb-4 text-black md:flex-row dark:text-white">
|
||||||
<div className="order-first w-full flex-none md:max-w-[125px]">
|
<div className="order-first w-full flex-none md:max-w-[125px]">
|
||||||
<Collections />
|
<Collections />
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,7 +64,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
|
|||||||
leaveFrom="translate-x-0"
|
leaveFrom="translate-x-0"
|
||||||
leaveTo="translate-x-full"
|
leaveTo="translate-x-full"
|
||||||
>
|
>
|
||||||
<Dialog.Panel className="fixed bottom-0 right-0 top-0 flex h-full w-full flex-col border-l border-neutral-200 bg-white/80 p-6 text-black backdrop-blur-xl dark:border-neutral-700 dark:bg-black/80 dark:text-white md:w-[390px]">
|
<Dialog.Panel className="fixed bottom-0 right-0 top-0 flex h-full w-full flex-col border-l border-neutral-200 bg-white/80 p-6 text-black backdrop-blur-xl md:w-[390px] dark:border-neutral-700 dark:bg-black/80 dark:text-white">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<p className="text-lg font-semibold">My Cart</p>
|
<p className="text-lg font-semibold">My Cart</p>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ const FooterMenuItem = ({ item }: { item: Menu }) => {
|
|||||||
<Link
|
<Link
|
||||||
href={item.path}
|
href={item.path}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'block p-2 text-lg underline-offset-4 hover:text-black hover:underline dark:hover:text-neutral-300 md:inline-block md:text-sm',
|
'block p-2 text-lg underline-offset-4 hover:text-black hover:underline md:inline-block md:text-sm dark:hover:text-neutral-300',
|
||||||
{
|
{
|
||||||
'text-black dark:text-neutral-300': active
|
'text-black dark:text-neutral-300': active
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,9 @@ export default async function Footer() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="text-sm text-neutral-500 dark:text-neutral-400">
|
<footer className="text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
<div className="mx-auto flex w-full max-w-7xl flex-col gap-6 border-t border-neutral-200 px-6 py-12 text-sm dark:border-neutral-700 md:flex-row md:gap-12 md:px-4 min-[1320px]:px-0">
|
<div className="mx-auto flex w-full max-w-7xl flex-col gap-6 border-t border-neutral-200 px-6 py-12 text-sm md:flex-row md:gap-12 md:px-4 min-[1320px]:px-0 dark:border-neutral-700">
|
||||||
<div>
|
<div>
|
||||||
<Link className="flex items-center gap-2 text-black dark:text-white md:pt-1" href="/">
|
<Link className="flex items-center gap-2 text-black md:pt-1 dark:text-white" href="/">
|
||||||
<LogoSquare size="sm" />
|
<LogoSquare size="sm" />
|
||||||
<span className="uppercase">{SITE_NAME}</span>
|
<span className="uppercase">{SITE_NAME}</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -15,9 +15,10 @@ export default async function Navbar() {
|
|||||||
return (
|
return (
|
||||||
<nav className="relative flex items-center justify-between p-4 lg:px-6">
|
<nav className="relative flex items-center justify-between p-4 lg:px-6">
|
||||||
<div className="block flex-none md:hidden">
|
<div className="block flex-none md:hidden">
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<MobileMenu menu={menu} />
|
<MobileMenu menu={menu} />
|
||||||
</Suspense> </div>
|
</Suspense>
|
||||||
|
</div>
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<div className="flex w-full md:w-1/3">
|
<div className="flex w-full md:w-1/3">
|
||||||
<Link href="/" className="mr-2 flex w-full items-center justify-center md:w-auto lg:mr-6">
|
<Link href="/" className="mr-2 flex w-full items-center justify-center md:w-auto lg:mr-6">
|
||||||
@ -42,7 +43,7 @@ export default async function Navbar() {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="hidden justify-center md:flex md:w-1/3">
|
<div className="hidden justify-center md:flex md:w-1/3">
|
||||||
<Suspense fallback={<SearchSkeleton />}>
|
<Suspense fallback={<SearchSkeleton />}>
|
||||||
<Search />
|
<Search />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,7 +35,7 @@ export default function MobileMenu({ menu }: { menu: Menu[] }) {
|
|||||||
<button
|
<button
|
||||||
onClick={openMobileMenu}
|
onClick={openMobileMenu}
|
||||||
aria-label="Open mobile menu"
|
aria-label="Open mobile menu"
|
||||||
className="flex h-11 w-11 items-center justify-center rounded-md border border-neutral-200 text-black transition-colors dark:border-neutral-700 dark:text-white md:hidden"
|
className="flex h-11 w-11 items-center justify-center rounded-md border border-neutral-200 text-black transition-colors md:hidden dark:border-neutral-700 dark:text-white"
|
||||||
>
|
>
|
||||||
<Bars3Icon className="h-4" />
|
<Bars3Icon className="h-4" />
|
||||||
</button>
|
</button>
|
||||||
@ -72,7 +72,7 @@ export default function MobileMenu({ menu }: { menu: Menu[] }) {
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div className="mb-4 w-full">
|
<div className="mb-4 w-full">
|
||||||
<Suspense fallback={<SearchSkeleton />}>
|
<Suspense fallback={<SearchSkeleton />}>
|
||||||
<Search />
|
<Search />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,4 +54,4 @@ export function SearchSkeleton() {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -21,18 +21,20 @@ export default function FilterList({ list, title }: { list: ListItem[]; title?:
|
|||||||
<>
|
<>
|
||||||
<nav>
|
<nav>
|
||||||
{title ? (
|
{title ? (
|
||||||
<h3 className="hidden text-xs text-neutral-500 dark:text-neutral-400 md:block">
|
<h3 className="hidden text-xs text-neutral-500 md:block dark:text-neutral-400">
|
||||||
{title}
|
{title}
|
||||||
</h3>
|
</h3>
|
||||||
) : null}
|
) : null}
|
||||||
<ul className="hidden md:block">
|
<ul className="hidden md:block">
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<FilterItemList list={list} />
|
<FilterItemList list={list} />
|
||||||
</Suspense> </ul>
|
</Suspense>{' '}
|
||||||
|
</ul>
|
||||||
<ul className="md:hidden">
|
<ul className="md:hidden">
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<FilterItemDropdown list={list} />
|
<FilterItemDropdown list={list} />
|
||||||
</Suspense> </ul>
|
</Suspense>{' '}
|
||||||
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -28,7 +28,7 @@ export function ProductDescription({ product }: { product: Product }) {
|
|||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<AddToCart variants={product.variants} availableForSale={product.availableForSale} />
|
<AddToCart variants={product.variants} availableForSale={product.availableForSale} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user