From 006c77a85786c24199db157d1d70f48b47311d35 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 11 Apr 2023 11:03:54 +0700 Subject: notif berhasil di tambahkan ke cart --- .../product/components/Product/ProductDesktop.jsx | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index dbe37068..0ff904af 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -10,12 +10,16 @@ import { toast } from 'react-hot-toast' import { updateItemCart } from '@/core/utils/cart' import { useRouter } from 'next/router' import { createSlug } from '@/core/utils/slug' +import BottomPopup from '@/core/components/elements/Popup/BottomPopup' +import { Toast } from 'flowbite-react' const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { const router = useRouter() const [lowestPrice, setLowestPrice] = useState(null) + const [addCartAlert, setAddCartAlert] = useState(false) + const getLowestPrice = useCallback(() => { const prices = product.variants.map((variant) => variant.price) const lowest = prices.reduce((lowest, price) => { @@ -54,7 +58,8 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { quantity, selected: true }) - toast.success('Berhasil menambahkan ke keranjang') + setAddCartAlert(true) + // toast.success('Berhasil menambahkan ke keranjang') } const handleBuy = (variantId) => { @@ -316,6 +321,25 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { +
+ setAddCartAlert(false)} + > +
+
+ {product.name} +
+
{product.name}
+
Lihat Keranjang
+
+
+
) -- cgit v1.2.3