diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-07-02 15:37:19 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-07-02 15:37:19 +0700 |
| commit | 5724e3b75c9bcb568d123fe86135205df1bb1c76 (patch) | |
| tree | 6ae46a1d8408d181d01d9569f52e86f5ccc7d76a /src/lib/variant | |
| parent | f287fc062c4ceb5039b5ca946da2e6854c27b007 (diff) | |
| parent | f7b024585b70f1bd600ba5e0d26368c532ac9723 (diff) | |
Merge branch 'release' into feature/step_approval
# Conflicts:
# src-migrate/modules/product-detail/components/PriceAction.tsx
# src/lib/transaction/components/Transaction.jsx
# src/pages/index.jsx
Diffstat (limited to 'src/lib/variant')
| -rw-r--r-- | src/lib/variant/components/VariantCard.jsx | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/lib/variant/components/VariantCard.jsx b/src/lib/variant/components/VariantCard.jsx index 9f1b5733..9f65fc3c 100644 --- a/src/lib/variant/components/VariantCard.jsx +++ b/src/lib/variant/components/VariantCard.jsx @@ -7,9 +7,14 @@ import { createSlug } from '@/core/utils/slug' import currencyFormat from '@/core/utils/currencyFormat' import { updateItemCart } from '@/core/utils/cart' import whatsappUrl from '@/core/utils/whatsappUrl' +import ImageNext from 'next/image'; +import { useMemo, useEffect, useState } from 'react'; const VariantCard = ({ product, openOnClick = true, buyMore = false }) => { const router = useRouter() + + + const addItemToCart = () => { toast.success('Berhasil menambahkan ke keranjang', { duration: 1500 }) @@ -27,11 +32,39 @@ const VariantCard = ({ product, openOnClick = true, buyMore = false }) => { const Card = () => ( <div className='flex gap-x-3'> <div className='w-4/12 flex items-center gap-x-2'> - <Image + + <div className="relative"> + <Image src={product.parent.image} alt={product.parent.name} className='object-contain object-center border border-gray_r-6 h-32 w-full rounded-md' /> + <div className="absolute top-0 right-4 flex mt-3"> + <div className="gambarB "> + {product.isSni && ( + <ImageNext + src="/images/sni-logo.png" + alt="SNI Logo" + className="w-2 h-5 object-contain object-top sm:h-6" + width={50} + height={50} + /> + )} + </div> + <div className="gambarC "> + {product.isTkdn && ( + <ImageNext + src="/images/TKDN.png" + alt="TKDN" + className="w-5 h-6 object-contain object-top ml-1 mr-1 sm:h-6" + width={50} + height={50} + /> + )} + </div> + </div> + </div> + </div> <div className='w-8/12 flex flex-col'> <p className='product-card__title wrap-line-ellipsis-2'>{product.parent.name}</p> |
