From 61af38ce93fcaee4fbcb34805156d5f8f1624cdb Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 21 Dec 2024 19:04:27 -0500 Subject: [PATCH] Fix loading state and skeleton layout --- .../src/components/dashboard/ProductGrid.jsx | 119 +++++++++--------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/dashboard/src/components/dashboard/ProductGrid.jsx b/dashboard/src/components/dashboard/ProductGrid.jsx index 5721733..25321a2 100644 --- a/dashboard/src/components/dashboard/ProductGrid.jsx +++ b/dashboard/src/components/dashboard/ProductGrid.jsx @@ -92,71 +92,72 @@ const ProductGrid = ({ ); const SkeletonProduct = () => ( - - + + - - -
- - + + +
+ +
- - + + + + + + + + + + + - - - - - - - - - - - + + ); const LoadingState = () => ( -
-
-
- - -
-
- -
+
+
+ + + + + + + + + + + + {[...Array(10)].map((_, i) => ( + + ))} + +
+ +
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
- - - - - - - - - - - - - - - - - - - - - - - - - {[...Array(10)].map((_, i) => ( - - ))} - -
); @@ -201,7 +202,7 @@ const ProductGrid = ({
- {loading && !products.length ? ( + {loading ? ( ) : error ? (