diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-01-19 02:32:43 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-01-19 02:32:43 +0000 |
| commit | 8bcadf6d43a44169c422305522784424c30c7b02 (patch) | |
| tree | 4666802b65784a949db4acad665a81de7297fc74 /src-migrate/modules/product-promo/components/Section.tsx | |
| parent | 065396828266e2de42cb0182c81ea2d7a5b00e2b (diff) | |
| parent | 91086d8b1af2e1c0ca9db38d037f6331c9e6131a (diff) | |
Merged in Feature/perf/product-detail (pull request #127)
Feature/perf/product detail
Diffstat (limited to 'src-migrate/modules/product-promo/components/Section.tsx')
| -rw-r--r-- | src-migrate/modules/product-promo/components/Section.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src-migrate/modules/product-promo/components/Section.tsx b/src-migrate/modules/product-promo/components/Section.tsx index 47e1de29..b6753be7 100644 --- a/src-migrate/modules/product-promo/components/Section.tsx +++ b/src-migrate/modules/product-promo/components/Section.tsx @@ -5,9 +5,10 @@ import { useQuery } from 'react-query' import { Button, Skeleton } from '@chakra-ui/react' import ProductPromoCard from './Card' -import { IPromotion } from '~/common/types/promotion' +import { IPromotion } from '~/types/promotion' import ProductPromoModal from "./Modal" import { useModalStore } from "../stores/useModalStore" +import clsxm from "~/libs/clsxm" type Props = { productId: number @@ -36,7 +37,13 @@ const ProductPromoSection = ({ productId }: Props) => { </div> )} - <Skeleton isLoaded={promotionsQuery.isSuccess} className="flex gap-x-4 overflow-x-auto min-h-[340px] px-4 md:px-0"> + <Skeleton + isLoaded={promotionsQuery.isSuccess} + className={clsxm( + "flex gap-x-4 overflow-x-auto px-4 md:px-0", { + "min-h-[340px]": promotions?.data && promotions?.data.length > 0 + })} + > {promotions?.data.map((promotion) => ( <div key={promotion.id} className="min-w-[400px] max-w-[400px]"> <ProductPromoCard promotion={promotion} /> |
