diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-30 13:51:19 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-30 13:51:48 +0700 |
| commit | 9c2b36fb15511b9f38492e133125a8b766c58a19 (patch) | |
| tree | a31117cd908034c973be20b9816374cd195965de /src-migrate/modules/product-detail/components/SimilarSide.tsx | |
| parent | 76e3eec8db414307cea6b11e3ebb461aed8e1e26 (diff) | |
Update product similar section
Diffstat (limited to 'src-migrate/modules/product-detail/components/SimilarSide.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/SimilarSide.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src-migrate/modules/product-detail/components/SimilarSide.tsx b/src-migrate/modules/product-detail/components/SimilarSide.tsx index 646a1c51..2ba8fa21 100644 --- a/src-migrate/modules/product-detail/components/SimilarSide.tsx +++ b/src-migrate/modules/product-detail/components/SimilarSide.tsx @@ -1,6 +1,4 @@ -import style from '../styles/side-similar.module.css' - -import React from 'react' +import { Skeleton } from '@chakra-ui/react' import ProductCard from '~/modules/product-card' import useProductSimilar from '~/modules/product-similar/hooks/useProductSimilar' @@ -13,13 +11,17 @@ type Props = { const SimilarSide = ({ product }: Props) => { const productSimilar = useProductSimilar({ name: product.name, - except: { productId: product.id, manufactureId: product.manufacture.id }, + except: { productId: product.id }, }) const products = productSimilar.data?.products || [] return ( - <div className={style['wrapper']}> + <Skeleton + isLoaded={!productSimilar.isLoading} + className="h-[500px] overflow-auto grid grid-cols-1 gap-y-4 divide-y divide-gray-300 border border-gray-300 rounded-lg" + rounded='lg' + > {products.map((product) => ( <ProductCard key={product.id} @@ -27,7 +29,7 @@ const SimilarSide = ({ product }: Props) => { layout='horizontal' /> ))} - </div> + </Skeleton> ) } |
