From 4e1bc974c409cc1707aae5857377c3bd20767ea3 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Wed, 2 Nov 2022 12:01:32 +0700 Subject: Add card placeholder --- src/icons/image-placeholder.svg | 1 + src/pages/shop/product/[slug].js | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/icons/image-placeholder.svg (limited to 'src') diff --git a/src/icons/image-placeholder.svg b/src/icons/image-placeholder.svg new file mode 100644 index 00000000..935e1097 --- /dev/null +++ b/src/icons/image-placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/pages/shop/product/[slug].js b/src/pages/shop/product/[slug].js index 82c0fef1..10b4c322 100644 --- a/src/pages/shop/product/[slug].js +++ b/src/pages/shop/product/[slug].js @@ -13,6 +13,8 @@ import { LazyLoadImage } from "react-lazy-load-image-component"; import 'swiper/css'; import 'react-lazy-load-image-component/src/effects/blur.css'; +import ImagePlaceholderIcon from '../../../icons/image-placeholder.svg'; + export async function getServerSideProps(context) { const { slug } = context.query; @@ -173,6 +175,32 @@ export default function ProductDetail({product}) { {similarProducts?.products?.map((product, index) => ())} + {similarProducts == null ? ( +
+
+
+ +
+
+
+
+
+
+ Loading... +
+
+
+ +
+
+
+
+
+
+ Loading... +
+
+ ) : ''} -- cgit v1.2.3