summaryrefslogtreecommitdiff
path: root/src/lib/quotation/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/quotation/components')
-rw-r--r--src/lib/quotation/components/Quotation.jsx4
-rw-r--r--src/lib/quotation/components/Quotationheader.jsx20
2 files changed, 11 insertions, 13 deletions
diff --git a/src/lib/quotation/components/Quotation.jsx b/src/lib/quotation/components/Quotation.jsx
index 3fac6f29..0ad042de 100644
--- a/src/lib/quotation/components/Quotation.jsx
+++ b/src/lib/quotation/components/Quotation.jsx
@@ -44,7 +44,7 @@ const Quotation = () => {
getProductsCheckout()
);
-const { setRefreshQuotation } = useProductCartContext();
+const { setRefreshCart } = useProductCartContext();
const SELF_PICKUP_ID = 32;
const [products, setProducts] = useState(null);
@@ -295,7 +295,7 @@ const { setRefreshQuotation } = useProductCartContext();
if (isSuccess?.id) {
for (const product of products) deleteItemCart({ productId: product.id });
router.push(`/shop/quotation/finish?id=${isSuccess.id}`);
- setRefreshQuotation(true);
+ setRefreshCart(true);
return;
}
diff --git a/src/lib/quotation/components/Quotationheader.jsx b/src/lib/quotation/components/Quotationheader.jsx
index 14743fd6..10e3e147 100644
--- a/src/lib/quotation/components/Quotationheader.jsx
+++ b/src/lib/quotation/components/Quotationheader.jsx
@@ -25,7 +25,7 @@ const Quotationheader = (quotationCount) => {
const [buttonLoading, SetButtonTerapkan] = useState(false);
const itemLoading = [1, 2, 3];
const [countQuotation, setCountQuotation] = useState(null);
- const { productCart, setProductCart, refreshCart, setRefreshCart, isLoading, setIsloading, productQuotation, setProductQuotation, refreshQuotation, setRefreshQuotation } =
+ const { productCart, setProductCart, refreshCart, setRefreshCart, isLoading, setIsloading, productQuotation, setProductQuotation } =
useProductCartContext();
const [isHovered, setIsHovered] = useState(false);
@@ -72,11 +72,11 @@ const Quotationheader = (quotationCount) => {
}, [qotation])
useEffect(() => {
- if (refreshQuotation) {
+ if (refreshCart) {
refreshCartf();
}
- setRefreshQuotation(false);
- }, [refreshQuotation, refreshCartf, setRefreshQuotation]);
+ setRefreshCart(false);
+ }, [ refreshCartf, setRefreshCart]);
useEffect(() => {
setCountQuotation(quotationCount.quotationCount);
@@ -150,9 +150,6 @@ const Quotationheader = (quotationCount) => {
>
<div className='p-2 flex justify-between items-center'>
<h5 className='text-base font-semibold leading-none'>Daftar Quotation</h5>
- <Link href='/my/quotations' class='text-sm font-medium text-red-600 underline'>
- Lihat Semua
- </Link>
</div>
<hr className='mt-3 mb-3 border border-gray-100' />
<div className='flow-root max-h-[250px] overflow-y-auto'>
@@ -221,7 +218,8 @@ const Quotationheader = (quotationCount) => {
<p className='font-semibold text-sm text-red-500'> {product.purchaseOrderName ? product.purchaseOrderName : '-'}</p>
</div>
</div>
- <div className='my-0.5 h-0.5 bg-gray-200'></div>
+ {/* <div className='my-0.5 h-0.5 bg-gray-200'></div> */}
+ <hr className='mt-3 mb-3 border border-gray-100' />
<div className='bagian bawah flex justify-between mt-2'>
<p className='font-semibold text-sm'>Total</p>
<p className='font-semibold text-sm'>{currencyFormat(product.amountUntaxed)}</p>
@@ -238,18 +236,18 @@ const Quotationheader = (quotationCount) => {
</div>
{auth && qotation.length > 0 && !isLoading && (
<>
- <div className='mt-3'>
+ <div className='mt-3 ml-1'>
<span className='text-gray-400 text-caption-2'>Subtotal Sebelum PPN : </span>
<span className='font-semibold text-red-600'>{currencyFormat(subTotal)}</span>
</div>
<div className='mt-5 mb-2'>
<button
type='button'
- className='btn-yellow rounded-lg w-full'
+ className='btn-solid-red rounded-lg w-full'
onClick={handleCheckout}
disabled={buttonLoading}
>
- {buttonLoading ? 'Loading...' : 'Buat Quotation'}
+ {buttonLoading ? 'Loading...' : 'Lihat Semua'}
</button>
</div>
</>