From 8550185eaebe220b4bf0f39300927d03ef69c3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Thu, 13 Jul 2023 12:05:07 +0200 Subject: [PATCH] feat(poc): carousel and improved sub-collections --- .../(collection)/[...collection]/page.tsx | 24 ++++-- app/search/layout.tsx | 14 +--- app/search/page.tsx | 32 +++++--- components/carousel.tsx | 63 ++++++++-------- components/collection/pagination.tsx | 40 ++++++---- components/layout/search/collections.tsx | 16 ++-- lib/shopware/criteria.ts | 2 +- lib/shopware/index.ts | 72 ++++++++++++------ lib/shopware/transform.ts | 73 +++++++++++++------ lib/shopware/types.ts | 30 ++++++++ 10 files changed, 239 insertions(+), 127 deletions(-) diff --git a/app/search/(collection)/[...collection]/page.tsx b/app/search/(collection)/[...collection]/page.tsx index 67e3c326d..0bce5ab50 100644 --- a/app/search/(collection)/[...collection]/page.tsx +++ b/app/search/(collection)/[...collection]/page.tsx @@ -3,6 +3,8 @@ import { Metadata } from 'next'; import { notFound } from 'next/navigation'; import Grid from 'components/grid'; +import Collections from 'components/layout/search/collections'; +import FilterList from 'components/layout/search/filter'; import ProductGridItems from 'components/layout/product-grid-items'; import Pagination from 'components/collection/pagination'; import { defaultSort, sorting } from 'lib/constants'; @@ -47,13 +49,21 @@ export default async function CategoryPage({ {products.length === 0 ? (

{`No products found in this collection`}

) : ( -
- - - - +
+
+ +
+
+ + + + +
+
+ +
)} diff --git a/app/search/layout.tsx b/app/search/layout.tsx index 872276d7e..7bd3f1593 100644 --- a/app/search/layout.tsx +++ b/app/search/layout.tsx @@ -1,21 +1,11 @@ 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'; +// @ToDo: We could use dynamic Layout per page, see https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts#with-typescript export default function SearchLayout({ children }: { children: React.ReactNode }) { return ( -
-
- -
-
{children}
-
- -
-
+ {children}