summaryrefslogtreecommitdiff
path: root/src/core/components/elements
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-09-29 15:35:44 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-09-29 15:35:44 +0700
commit607b943dae3cacffcd76a6763fddc3c218792d74 (patch)
tree4d90ec2813d4bdb65cda1f5fb51e3f59024c6bf8 /src/core/components/elements
parent616e9292cd1db6bbc0cd28208e5403dd667152b9 (diff)
Add except for non publish product solr
Diffstat (limited to 'src/core/components/elements')
-rw-r--r--src/core/components/elements/Skeleton/ProductCardSkeleton.jsx68
1 files changed, 44 insertions, 24 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 = () => (
- <div
- role='status'
- className='p-4 max-w-sm rounded border border-gray-300 shadow animate-pulse md:p-6'
- >
- <div className='flex items-center justify-center h-36 mb-4 bg-gray-300 rounded' aria-busy>
- <svg
- className='w-12 h-12 text-gray-200'
- xmlns='http://www.w3.org/2000/svg'
- aria-hidden='true'
- fill='currentColor'
- viewBox='0 0 640 512'
- >
- <path d='M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z' />
- </svg>
- </div>
- <div className='h-2 bg-gray-200 rounded-full w-10 mb-1'></div>
- <div className='h-2.5 bg-gray-200 rounded-full w-full mb-4'></div>
- <div className='h-2 bg-gray-200 rounded-full mb-2.5'></div>
- <div className='h-2 bg-gray-200 rounded-full mb-2.5'></div>
- <div className='h-2 bg-gray-200 rounded-full'></div>
- <span className='sr-only'>Loading...</span>
- </div>
-)
+import { Box, HStack, Skeleton, SkeletonText, VStack, useBreakpointValue } from '@chakra-ui/react'
+
+const ProductCardSkeleton = () => {
+ const wrapperHeight = useBreakpointValue({ base: '300px', md: '350px' })
+ return (
+ <Box
+ role='status'
+ w='100%'
+ bgColor='white'
+ h={wrapperHeight}
+ borderWidth='1px'
+ borderRadius='md'
+ >
+ <Skeleton height='50%' {...skeletonColors} />
+
+ <VStack padding='10px 12px 16px 12px' height='50%'>
+ <Box w='full'>
+ <Skeleton height='12px' w='30%' {...skeletonColors} />
+ <SkeletonText
+ noOfLines={2}
+ spacing='8px'
+ skeletonHeight='12px'
+ mt='12px'
+ {...skeletonColors}
+ />
+ </Box>
+
+ <VStack spacing='12px' alignItems='flex-start' mt='20px' w='full'>
+ <HStack spacing='8px' w='full'>
+ <Skeleton height='12px' w='60%' {...skeletonColors} />
+ <Skeleton height='12px' w='10%' {...skeletonColors} />
+ </HStack>
+ <Skeleton height='12px' w='50%' {...skeletonColors} />
+ </VStack>
+ </VStack>
+ <span className='sr-only'>Loading...</span>
+ </Box>
+ )
+}
+
+const skeletonColors = {
+ startColor: 'gray.100',
+ endColor: 'gray.300'
+}
export default ProductCardSkeleton