summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-promo/components/Section.tsx
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-08-01 01:49:38 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-08-01 01:49:38 +0000
commitf0296b4ef91158ef9c12d4a5b4f17c574352916f (patch)
treeab31341b2be2546e28963b6634747a6dc22e28c5 /src-migrate/modules/product-promo/components/Section.tsx
parentb0f4055042aa0efbbef1ebafbbb032dc4b67da58 (diff)
parent0abd42f8b528b3166169fef7093d4d8b22f3fb79 (diff)
Merged in Feature/iman-cart-popup (pull request #193)
<iman> add pop up when hit keranjang button
Diffstat (limited to 'src-migrate/modules/product-promo/components/Section.tsx')
-rw-r--r--src-migrate/modules/product-promo/components/Section.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src-migrate/modules/product-promo/components/Section.tsx b/src-migrate/modules/product-promo/components/Section.tsx
index 4e8a7dd5..ff565539 100644
--- a/src-migrate/modules/product-promo/components/Section.tsx
+++ b/src-migrate/modules/product-promo/components/Section.tsx
@@ -9,12 +9,14 @@ import { IPromotion } from '~/types/promotion'
import { useModalStore } from "../stores/useModalStore"
import ProductPromoCard from './Card'
import ProductPromoModal from "./Modal"
+import { IProductDetail } from '~/types/product';
type Props = {
productId: number;
+ product: IProductDetail
}
-const ProductPromoSection = ({ productId }: Props) => {
+const ProductPromoSection = ({product, productId }: Props) => {
const promotionsQuery = useQuery({
queryKey: [`promotions.highlight`, productId],
queryFn: async () => await fetch(`/api/product-variant/${productId}/promotion/highlight`).then((res) => res.json()) as { data: IPromotion[] }
@@ -23,7 +25,7 @@ const ProductPromoSection = ({ productId }: Props) => {
const promotions = promotionsQuery.data
const { openModal } = useModalStore()
-
+ console.log("productId",productId)
return (
<SmoothRender
isLoaded={(promotions?.data && promotions?.data.length > 0) || false}
@@ -50,7 +52,7 @@ const ProductPromoSection = ({ productId }: Props) => {
>
{promotions?.data.map((promotion) => (
<div key={promotion.id} className="min-w-[400px] max-w-[400px]">
- <ProductPromoCard promotion={promotion} />
+ <ProductPromoCard product={product} promotion={promotion} />
</div>
))}
</Skeleton>