diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/components/elements/Image/Image.jsx | 12 | ||||
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarDesktop.jsx | 20 | ||||
| -rw-r--r-- | src/core/components/elements/Skeleton/ProductCardSkeleton.jsx | 68 |
3 files changed, 50 insertions, 50 deletions
diff --git a/src/core/components/elements/Image/Image.jsx b/src/core/components/elements/Image/Image.jsx index ba6bf50d..d7b19821 100644 --- a/src/core/components/elements/Image/Image.jsx +++ b/src/core/components/elements/Image/Image.jsx @@ -9,18 +9,18 @@ import 'react-lazy-load-image-component/src/effects/opacity.css' * @param {string} props.alt - Alternative text to be displayed if the image is not found. * @returns {JSX.Element} - Rendered `Image` component. */ -const Image = ({ ...props }) => ( - <> +const Image = ({ ...props }) => { + return ( <LazyLoadImage {...props} src={props.src || '/images/noimage.jpeg'} placeholderSrc='/images/indoteknik-placeholder.png' + effect='opacity' alt={props.src ? props.alt : 'Image Not Found - Indoteknik'} wrapperClassName='bg-white' + loading='eager' /> - </> -) - -Image.defaultProps = LazyLoadImage.defaultProps + ) +} export default Image diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx index 3aba55c9..fb94e4a6 100644 --- a/src/core/components/elements/Navbar/NavbarDesktop.jsx +++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx @@ -111,26 +111,6 @@ const NavbarDesktop = () => { Quotation </Link> <Cardheader cartCount={cartCount}/> - {/* <Link - href='/shop/cart' - target='_blank' - rel='noreferrer' - className='flex items-center gap-x-2 !text-gray_r-12/80' - > - <div className={`relative ${cartCount > 0 && 'mr-2'}`}> - <ShoppingCartIcon className='w-7' /> - {cartCount > 0 && ( - <span className='absolute -top-2 -right-2 badge-solid-red rounded-full w-5 h-5 flex items-center justify-center'> - {cartCount} - </span> - )} - </div> - <span> - Keranjang - <br /> - Belanja - </span> - </Link> */} <Link target='_blank' rel='noreferrer' diff --git a/src/core/components/elements/Skeleton/ProductCardSkeleton.jsx b/src/core/components/elements/Skeleton/ProductCardSkeleton.jsx index 84d1c0d1..1e0ca6a3 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.200', + endColor: 'gray.400' +} export default ProductCardSkeleton |
