summaryrefslogtreecommitdiff
path: root/src/lib/variant/components
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-10 14:20:29 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-10 14:20:29 +0700
commite3d0de0ba20eee9d53e95c5525907b099d2b5b04 (patch)
treecefc95935f615682b2c820f5046005234cfbbf2b /src/lib/variant/components
parentdc204e9cdbcf7faf81dba825db608be2c918589d (diff)
<iman> update reaject button & component position
Diffstat (limited to 'src/lib/variant/components')
-rw-r--r--src/lib/variant/components/VariantCard.jsx31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/lib/variant/components/VariantCard.jsx b/src/lib/variant/components/VariantCard.jsx
index c629c987..5d95ee70 100644
--- a/src/lib/variant/components/VariantCard.jsx
+++ b/src/lib/variant/components/VariantCard.jsx
@@ -122,7 +122,7 @@ const VariantCard = ({ product, openOnClick = true, buyMore = false }) => {
<Link href={createSlug('/shop/product/', product.parent.name, product.parent.id)}>
<Card />
</Link>
- {buyMore && (
+ {buyMore && (!transaction?.data?.productsRejectLine.some(pr => pr.id === product.id)) && (
<div className='flex justify-end gap-x-2 mb-2'>
<button
type='button'
@@ -133,26 +133,15 @@ const VariantCard = ({ product, openOnClick = true, buyMore = false }) => {
</button>
{/* {auth?.feature.soApproval && (auth.webRole == 2 || auth.webRole == 3) && (transaction.data.isReaject == false) && ( */}
{auth?.feature.soApproval && (auth.webRole == 2 || auth.webRole == 3) && (router.asPath.includes("/my/quotations/")) && (
-
- <button
- className="bg-red-500 text-white py-1 px-3 rounded"
- onClick={() => openModal(product)}
- >
- Reject
- </button>
-
- )}
- {/* {transaction.data.isReaject && (
-
- <button
- className="bg-gray-400 text-white py-1 px-3 rounded"
- onClick={() => openModal(product)}
- disabled
- >
- Direject
- </button>
-
- )} */}
+ !transaction?.data?.productsRejectLine.some(pr => pr.id === product.id) && (
+ <button
+ className="bg-red-500 text-white py-1 px-3 rounded"
+ onClick={() => openModal(product)}
+ >
+ Reject
+ </button>
+ )
+ )}
{isModalOpen && (
<div className='fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center'>
<div className='bg-white p-4 rounded w-96