summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-promo/components
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-08-02 10:16:46 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-08-02 10:16:46 +0000
commitd8510399c21b2cf4bf606441397a0142bc265a94 (patch)
tree75543baf82a73fb7e8dea6c8a1c353e02c57bbcd /src-migrate/modules/product-promo/components
parent6a2c25e83a45eeb5d613a99a0caa6f0ec1aae15f (diff)
parent55c9f5e1fb868c85e704529ac914b3d75fc7744e (diff)
Merged in Feature/new-cart-popup (pull request #208)
Feature/new cart popup
Diffstat (limited to 'src-migrate/modules/product-promo/components')
-rw-r--r--src-migrate/modules/product-promo/components/AddToCart.tsx4
-rw-r--r--src-migrate/modules/product-promo/components/Card.tsx5
-rw-r--r--src-migrate/modules/product-promo/components/ModalContent.tsx1
-rw-r--r--src-migrate/modules/product-promo/components/Section.tsx4
4 files changed, 6 insertions, 8 deletions
diff --git a/src-migrate/modules/product-promo/components/AddToCart.tsx b/src-migrate/modules/product-promo/components/AddToCart.tsx
index f066a4c8..10904f90 100644
--- a/src-migrate/modules/product-promo/components/AddToCart.tsx
+++ b/src-migrate/modules/product-promo/components/AddToCart.tsx
@@ -16,7 +16,6 @@ import LazyLoad from 'react-lazy-load'
import ProductSimilar from '../../../../src/lib/product/components/ProductSimilar';
import { IProductDetail } from '~/types/product';
import { useProductCartContext } from '@/contexts/ProductCartContext'
-
type Props = {
promotion: IPromotion
product: IProductDetail
@@ -32,11 +31,11 @@ const ProductPromoAddToCart = ({product, promotion }: Props) => {
const [status, setStatus] = useState<Status>('idle')
const { productCart, setRefreshCart, setProductCart, refreshCart, isLoading, setIsloading } =
useProductCartContext()
+
const productSimilarQuery = [
promotion?.name,
`fq=-product_id_i:${promotion.products[0].product_id}`,
].join('&');
-
const [addCartAlert, setAddCartAlert] = useState(false);
const handleButton = async () => {
@@ -139,7 +138,6 @@ const ProductPromoAddToCart = ({product, promotion }: Props) => {
</Link>
</div>
</div>
-
<div className='mt-8 mb-4'>
<div className='text-h-sm font-semibold mb-6'>
Kamu Mungkin Juga Suka
diff --git a/src-migrate/modules/product-promo/components/Card.tsx b/src-migrate/modules/product-promo/components/Card.tsx
index b286aa5b..5c323276 100644
--- a/src-migrate/modules/product-promo/components/Card.tsx
+++ b/src-migrate/modules/product-promo/components/Card.tsx
@@ -16,7 +16,6 @@ import ProductPromoItem from './Item'
import ProductPromoAddToCart from "./AddToCart"
import ProductPromoCardCountdown from "./CardCountdown"
import { IProductDetail } from '~/types/product';
-
import MobileView from '../../../../src/core/components/views/MobileView';
import DesktopView from '../../../../src/core/components/views/DesktopView';
@@ -133,7 +132,7 @@ const ProductPromoCard = ({product, promotion}: Props) => {
</div>
<div>
- <ProductPromoAddToCart product={product} promotion={promotion} />
+ <ProductPromoAddToCart product={product} promotion={promotion} />
</div>
</div>
@@ -190,7 +189,7 @@ const ProductPromoCard = ({product, promotion}: Props) => {
</div>
</div>
<div>
- <ProductPromoAddToCart product={product} promotion={promotion} />
+ <ProductPromoAddToCart product={product} promotion={promotion} />
</div>
</div>
diff --git a/src-migrate/modules/product-promo/components/ModalContent.tsx b/src-migrate/modules/product-promo/components/ModalContent.tsx
index 44ad52d6..256ef61a 100644
--- a/src-migrate/modules/product-promo/components/ModalContent.tsx
+++ b/src-migrate/modules/product-promo/components/ModalContent.tsx
@@ -5,6 +5,7 @@ import { getVariantPromoByCategory } from "~/services/productVariant"
import { useModalStore } from "../stores/useModalStore"
import ProductPromoCard from "./Card"
+
import { IProductDetail } from '~/types/product';
type Props = {
product: IProductDetail
diff --git a/src-migrate/modules/product-promo/components/Section.tsx b/src-migrate/modules/product-promo/components/Section.tsx
index 05b849c7..1228a6f0 100644
--- a/src-migrate/modules/product-promo/components/Section.tsx
+++ b/src-migrate/modules/product-promo/components/Section.tsx
@@ -13,10 +13,10 @@ import { IProductDetail } from '~/types/product';
type Props = {
productId: number;
- product: IProductDetail
+ product: IProductDetail;
}
-const ProductPromoSection = ({product, 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[] }