From 0112bdbacf020bba36e14fed19e8e4d7d8bd9adf Mon Sep 17 00:00:00 2001 From: Jakob-SA Date: Sat, 23 Nov 2024 21:51:58 +0100 Subject: [PATCH] conditional rendering in catalougue --- Frontend/src/index.css | 2 +- .../product-catalogue-page.tsx | 32 +++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Frontend/src/index.css b/Frontend/src/index.css index 4290c3c..ad84a7f 100644 --- a/Frontend/src/index.css +++ b/Frontend/src/index.css @@ -36,8 +36,8 @@ a:hover { body { margin: 0; + padding-top: 5rem; display: flex; - place-items: center; min-width: 320px; min-height: 100vh; } diff --git a/Frontend/src/views/product-catalogue/product-catalogue-page.tsx b/Frontend/src/views/product-catalogue/product-catalogue-page.tsx index d156b43..0a5a428 100644 --- a/Frontend/src/views/product-catalogue/product-catalogue-page.tsx +++ b/Frontend/src/views/product-catalogue/product-catalogue-page.tsx @@ -63,7 +63,7 @@ const ProductCataloguePage: React.FC = () => { } return ( -
+

Product Catalogue

{ className="mb-4 p-2 border border-gray-300 rounded" />
- {products.map((product) => ( - - - - ))} + {products.length === 0 ? ( +
+ No products match your search. +
+ ) : ( + products.map((product) => ( + + + + )) + )}
-
+