summaryrefslogtreecommitdiff
path: root/src-migrate/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules')
-rw-r--r--src-migrate/modules/product-detail/components/PriceAction.tsx20
1 files changed, 16 insertions, 4 deletions
diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx
index 5171308c..a87f8ae0 100644
--- a/src-migrate/modules/product-detail/components/PriceAction.tsx
+++ b/src-migrate/modules/product-detail/components/PriceAction.tsx
@@ -8,6 +8,7 @@ import { IProductDetail } from '~/types/product';
import { useProductDetail } from '../stores/useProductDetail';
import AddToCart from './AddToCart';
import odooApi from '~/libs/odooApi';
+import { Button, Skeleton } from '@chakra-ui/react';
type Props = {
product: IProductDetail;
@@ -52,6 +53,10 @@ const PriceAction = ({ product }: Props) => {
fetchData();
}, [selectedVariant]);
+ useEffect(() => {
+ setQuantityInput('1');
+ }, [selectedVariant]);
+
let voucherPastiHemat = 0;
if (
@@ -137,10 +142,17 @@ const PriceAction = ({ product }: Props) => {
</div>
<div>
- <span className={sla?.qty < 10 ? 'text-red-600 font-medium' : ''}>
- {' '}
+ <Skeleton
+ isLoaded={sla}
+ h='21px'
+ // w={16}
+ className={sla?.qty < 10 ? 'text-red-600 font-medium' : ''}
+ >
Stock : {sla?.qty}{' '}
- </span>
+ </Skeleton>
+ {/* <span className={sla?.qty < 10 ? 'text-red-600 font-medium' : ''}>
+ {' '}
+ </span> */}
</div>
<div>
{product?.is_in_bu && (
@@ -157,7 +169,7 @@ const PriceAction = ({ product }: Props) => {
</div>
</div>
{qtyPickUp > 0 && (
- <div className='text-[10px] mt-1 text-red-500 italic'>
+ <div className='text-[12px] mt-1 text-red-500 italic'>
* {qtyPickUp} barang bisa di pickup
</div>
)}