From 607b943dae3cacffcd76a6763fddc3c218792d74 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 29 Sep 2023 15:35:44 +0700 Subject: Add except for non publish product solr --- .../elements/Skeleton/ProductCardSkeleton.jsx | 68 ++++++++++++++-------- .../components/Skeleton/PopularProductSkeleton.jsx | 3 +- src/pages/api/shop/search.js | 3 +- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/core/components/elements/Skeleton/ProductCardSkeleton.jsx b/src/core/components/elements/Skeleton/ProductCardSkeleton.jsx index 84d1c0d1..e46511f8 100644 --- a/src/core/components/elements/Skeleton/ProductCardSkeleton.jsx +++ b/src/core/components/elements/Skeleton/ProductCardSkeleton.jsx @@ -1,26 +1,46 @@ -const ProductCardSkeleton = () => ( -
-
- -
-
-
-
-
-
- Loading... -
-) +import { Box, HStack, Skeleton, SkeletonText, VStack, useBreakpointValue } from '@chakra-ui/react' + +const ProductCardSkeleton = () => { + const wrapperHeight = useBreakpointValue({ base: '300px', md: '350px' }) + return ( + + + + + + + + + + + + + + + + + + Loading... + + ) +} + +const skeletonColors = { + startColor: 'gray.100', + endColor: 'gray.300' +} export default ProductCardSkeleton diff --git a/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx b/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx index 29fda966..754bdd57 100644 --- a/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx +++ b/src/lib/home/components/Skeleton/PopularProductSkeleton.jsx @@ -11,7 +11,8 @@ const PopularProductSkeleton = () => ( -
+
+ diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index d465d94b..54c89716 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -49,7 +49,8 @@ export default async function handler(req, res) { 'qf=name_s', `start=${offset}`, `rows=${limit}`, - `sort=${paramOrderBy}` + `sort=${paramOrderBy}`, + `facet.query=-publish_b:false` ] if (priceFrom > 0 || priceTo > 0) { -- cgit v1.2.3