diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-08-02 10:01:12 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-08-02 10:01:12 +0000 |
| commit | 6a2c25e83a45eeb5d613a99a0caa6f0ec1aae15f (patch) | |
| tree | 4a1b314ae72d919229735cd6586e0eeae47257bd | |
| parent | 263513f288a164d4e14cb3ea407877f3fec3013b (diff) | |
| parent | 36e877845f5b3240ed383ce3ab42624e8b7d4357 (diff) | |
Merged in Feature/iman-unchek-cart (pull request #207)
<iman> update unchek cart
| -rw-r--r-- | src-migrate/pages/shop/cart/index.tsx | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx index 3bc857a6..8d9ea91c 100644 --- a/src-migrate/pages/shop/cart/index.tsx +++ b/src-migrate/pages/shop/cart/index.tsx @@ -33,8 +33,6 @@ const CartPage = () => { const { setRefreshCart } = useProductCartContext() const [isTop, setIsTop] = useState(true); - - console.log("lokasi",window.scrollY) useEffect(() => { const handleScroll = () => { setIsTop(window.scrollY < 200); @@ -120,48 +118,51 @@ const CartPage = () => { return ( <> - <div className={style['title']}>Keranjang Belanja</div> - <div className='h-2' /> - <div className={`flex items-center object-center justify-between w-3/4 ${isTop ? 'border-b-[0px]' : 'border-b-[1px]'} sticky top-[180px] bg-white py-4 border-gray-300 z-50`}> - <div className='flex items-center object-center'> - {isLoad && ( - <Spinner className='my-auto' size='sm' /> - )} - {!isLoad && ( - <Checkbox - borderColor='gray.600' - colorScheme='red' - size='lg' - isChecked={hasSelectedAll} - onChange={handleChange} - /> - )} - <p className='p-2 text-caption-2'> - {hasSelectedAll ? "Unchek all" : "Select all"} - </p> - </div> - <div className='delate all flex items-center object-center'> - <Tooltip - label={clsxm({ - 'Tidak ada item yang dipilih': !hasSelected, - })} - > - <Button - bg='#fadede' - variant='outline' - colorScheme='red' - w='full' - isDisabled={!hasSelected || hasSelectNoPrice} - onClick={handleDelete} - > - {isLoadDelete && <Spinner size='xs' />} - {!isLoadDelete && <Trash2Icon size={16} />} - <p className='text-sm ml-2'> - Hapus Barang - </p> - </Button> - </Tooltip> + <div className={`${isTop ? 'border-b-[0px]' : 'border-b-[1px]'} sticky top-[180px] bg-white py-4 border-gray-300 z-50 w-3/4`}> + <div className={`${style['title']}`}>Keranjang Belanja</div> + <div className='h-2' /> + <div className={`flex items-center object-center justify-between `}> + <div className='flex items-center object-center'> + {isLoad && ( + <Spinner className='my-auto' size='sm' /> + )} + {!isLoad && ( + <Checkbox + borderColor='gray.600' + colorScheme='red' + size='lg' + isChecked={hasSelectedAll} + onChange={handleChange} + /> + )} + <p className='p-2 text-caption-2'> + {hasSelectedAll ? "Unchek all" : "Select all"} + </p> </div> + <div className='delate all flex items-center object-center'> + <Tooltip + label={clsxm({ + 'Tidak ada item yang dipilih': !hasSelected, + })} + > + <Button + bg='#fadede' + variant='outline' + colorScheme='red' + w='full' + isDisabled={!hasSelected || hasSelectNoPrice} + onClick={handleDelete} + > + {isLoadDelete && <Spinner size='xs' />} + {!isLoadDelete && <Trash2Icon size={16} />} + <p className='text-sm ml-2'> + Hapus Barang + </p> + </Button> + </Tooltip> + </div> + </div> + </div> <div className={style['content']}> |
