diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-06-14 13:22:20 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-06-14 13:22:20 +0700 |
| commit | eb4ae7be05ed97bd02b7f3e9cc56393f435188e2 (patch) | |
| tree | 6518bdd7b1801f492a6c1588ff828a2c8fa70dd2 /src/lib/product/components/Product | |
| parent | 702f43a7190d65c2370e7019311cc26c2cc0eafd (diff) | |
layout promotion program di detail product dan layout modal popup
Diffstat (limited to 'src/lib/product/components/Product')
| -rw-r--r-- | src/lib/product/components/Product/ProductDesktop.jsx | 24 | ||||
| -rw-r--r-- | src/lib/product/components/Product/ProductMobile.jsx | 6 |
2 files changed, 11 insertions, 19 deletions
diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index c3addbb9..f1a001a6 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -15,9 +15,12 @@ import ProductCard from '../ProductCard' import productSimilarApi from '../../api/productSimilarApi' import whatsappUrl from '@/core/utils/whatsappUrl' import PromotionType from '@/lib/promotinProgram/components/PromotionType' +import useAuth from '@/core/hooks/useAuth' const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { const router = useRouter() + const auth = useAuth() + const { slug } = router.query const [lowestPrice, setLowestPrice] = useState(null) @@ -55,6 +58,10 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { } const handleAddToCart = (variantId) => { + if(!auth) { + router.push(`/login?next=/shop/product/${slug}`) + return + } const quantity = variantQuantityRefs.current[variantId].value if (!validQuantity(quantity)) return updateItemCart({ @@ -159,8 +166,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { </div> </div> <div className='pt-3'> - <div className='text-h-lg font-semibold'>Promotion Program</div> - <div className='flex mt-3'> + <div className='flex mt-1'> <PromotionType></PromotionType> </div> </div> @@ -237,7 +243,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { </span> )} </h3> - <div className='mt-5'> + {/* <div className='mt-5'> <button type='button' onClick={() => setPromotionType(true)} @@ -246,7 +252,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { <span className='text-left'>%</span> <span className='text-left ml-5'>Makin Hemat Pakai Promo </span> </button> - </div> + </div> */} {product.variants.length > 1 ? ( <button type='button' @@ -420,16 +426,6 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { </LazyLoad> </div> </BottomPopup> - <BottomPopup - className='!w-[32%]' - title='Pakai Promo' - active={promotionType} - close={() => setPromotionType(false)} - > - <div className='flex mt-4'> - <PromotionType></PromotionType> - </div> - </BottomPopup> </div> </DesktopView> ) diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index 5ed796ae..1c2974b0 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -172,11 +172,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { <div className='p-4'> <div className='mb-5'> - {/* <PromotionType></PromotionType> */} - <button type='button' className='text-gray-900 flex p-3 rounded-lg bg-white border border-gray-300 hover:bg-gray-100 py-2.5 w-[100%]'> - <span className='text-left'>%</span> - <span className='text-left ml-5'>Makin Hemat Pakai Promo</span> - </button> + <PromotionType></PromotionType> </div> <div> <label className='flex justify-between'> |
