diff --git a/app/globals.css b/app/globals.css index 0a6d36768..21bbc4a01 100644 --- a/app/globals.css +++ b/app/globals.css @@ -2,12 +2,6 @@ @tailwind components; @tailwind utilities; -@media (prefers-color-scheme: dark) { - html { - color-scheme: dark; - } -} - @supports (font: -apple-system-body) and (-webkit-appearance: none) { img[loading='lazy'] { clip-path: inset(0.6px); diff --git a/app/search/[collection]/page.tsx b/app/search/[collection]/page.tsx index 25416d544..181186fe4 100644 --- a/app/search/[collection]/page.tsx +++ b/app/search/[collection]/page.tsx @@ -2,9 +2,14 @@ import { getCollection, getCollectionProducts } from 'lib/shopify'; import { Metadata } from 'next'; import { notFound } from 'next/navigation'; +import Breadcrumb from 'components/breadcrumb'; +import BreadcrumbHome from 'components/breadcrumb/breadcrumb-home'; import Grid from 'components/grid'; import ProductGridItems from 'components/layout/product-grid-items'; +import Filters from 'components/layout/search/filters'; +import SortingMenu from 'components/layout/search/sorting-menu'; import { defaultSort, sorting } from 'lib/constants'; +import { Suspense } from 'react'; export const runtime = 'edge'; @@ -33,17 +38,43 @@ export default async function CategoryPage({ }) { const { sort } = searchParams as { [key: string]: string }; const { sortKey, reverse } = sorting.find((item) => item.slug === sort) || defaultSort; - const products = await getCollectionProducts({ collection: params.collection, sortKey, reverse }); + const productsData = getCollectionProducts({ collection: params.collection, sortKey, reverse }); + const collectionData = getCollection(params.collection); + + const [products, collection] = await Promise.all([productsData, collectionData]); return ( -
- {products.length === 0 ? ( -

{`No products found in this collection`}

- ) : ( - - - - )} -
+ <> +
+ }> + + +
+ {collection ? ( +
+

{collection.title}

+

{collection.description}

+
+ ) : null} +
+ +
+
+ {products.length === 0 ? ( +

{`No products found in this collection`}

+ ) : ( + + +
+ + + +
+
+ )} +
+ ); } diff --git a/app/search/layout.tsx b/app/search/layout.tsx index 011d41e8b..7bdb8cf47 100644 --- a/app/search/layout.tsx +++ b/app/search/layout.tsx @@ -1,21 +1,10 @@ import Footer from 'components/layout/footer'; -import Collections from 'components/layout/search/collections'; -import FilterList from 'components/layout/search/filter'; -import { sorting } from 'lib/constants'; import { Suspense } from 'react'; export default function SearchLayout({ children }: { children: React.ReactNode }) { return ( -
-
- -
-
{children}
-
- -
-
+
{children}