diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-02 14:18:31 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-02 14:18:31 +0700 |
| commit | 95d51b30154b09e4105ea011aba8782d74fbf1e8 (patch) | |
| tree | 2fd5039ca4dc6a7ade8034ccae39a9524484efde /src-migrate/pages | |
| parent | 455e7b8daddec77f95929a7cb0eb31e8fa934e6d (diff) | |
<iman> update unchek cart
Diffstat (limited to 'src-migrate/pages')
| -rw-r--r-- | src-migrate/pages/shop/cart/index.tsx | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx index 2204857a..e5e2c5cb 100644 --- a/src-migrate/pages/shop/cart/index.tsx +++ b/src-migrate/pages/shop/cart/index.tsx @@ -31,20 +31,7 @@ const CartPage = () => { const { loadCart, cart, summary } = useCartStore(); const useDivvice = useDevice(); const { setRefreshCart } = useProductCartContext() - const [isTop, setIsTop] = useState(true); - - useEffect(() => { - const handleScroll = () => { - console.log("lokasi",window.scrollY) - setIsTop(window.scrollY < 200); - }; - - window.addEventListener('scroll', handleScroll); - return () => { - window.removeEventListener('scroll', handleScroll); - }; - }, []); useEffect(() => { if (typeof auth === 'object' && !cart) { @@ -122,7 +109,7 @@ const CartPage = () => { <> <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 justify-between w-3/4 ${window.scrollY < 200 ? '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' /> |
