summaryrefslogtreecommitdiff
path: root/src-migrate/pages
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-02 17:00:20 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-02 17:00:20 +0700
commit36e877845f5b3240ed383ce3ab42624e8b7d4357 (patch)
tree55a59ee47928faefd18e20b338d57b3572a647e5 /src-migrate/pages
parent112b5a9fa738594749796fb65ede0c8ec900a84f (diff)
<iman> update unchek cart
Diffstat (limited to 'src-migrate/pages')
-rw-r--r--src-migrate/pages/shop/cart/index.tsx87
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']}>