summaryrefslogtreecommitdiff
path: root/src/lib/cart/components
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-08-02 10:16:46 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-08-02 10:16:46 +0000
commitd8510399c21b2cf4bf606441397a0142bc265a94 (patch)
tree75543baf82a73fb7e8dea6c8a1c353e02c57bbcd /src/lib/cart/components
parent6a2c25e83a45eeb5d613a99a0caa6f0ec1aae15f (diff)
parent55c9f5e1fb868c85e704529ac914b3d75fc7744e (diff)
Merged in Feature/new-cart-popup (pull request #208)
Feature/new cart popup
Diffstat (limited to 'src/lib/cart/components')
-rw-r--r--src/lib/cart/components/Cartheader.jsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx
index 7d43a4da..f76634ce 100644
--- a/src/lib/cart/components/Cartheader.jsx
+++ b/src/lib/cart/components/Cartheader.jsx
@@ -7,10 +7,12 @@ import useAuth from '@/core/hooks/useAuth'
import { useRouter } from 'next/router'
import odooApi from '@/core/api/odooApi'
import { useProductCartContext } from '@/contexts/ProductCartContext'
+import currencyFormat from '@/core/utils/currencyFormat'
+import Image from '@/core/components/elements/Image/Image'
+import { createSlug } from '@/core/utils/slug'
import whatsappUrl from '@/core/utils/whatsappUrl'
import { AnimatePresence, motion } from 'framer-motion'
import style from '../../../../src-migrate/modules/cart/styles/item-promo.module.css'
-
const { ShoppingCartIcon, PhotoIcon } = require('@heroicons/react/24/outline')
const { default: Link } = require('next/link')
@@ -27,7 +29,6 @@ const Cardheader = (cartCount) => {
const [isHovered, setIsHovered] = useState(false)
const [isTop, setIsTop] = useState(true)
-
const products = useMemo(() => {
return productCart?.products || []
}, [productCart])
@@ -89,7 +90,6 @@ const Cardheader = (cartCount) => {
const handleScroll = () => {
setIsTop(window.scrollY === 0)
}
-
window.addEventListener('scroll', handleScroll)
return () => {
window.removeEventListener('scroll', handleScroll)
@@ -139,7 +139,6 @@ const Cardheader = (cartCount) => {
transition={{ duration: 0.15, top: { duration: 0.3 } }}
className={`fixed left-0 w-full h-full bg-black/50 z-10`}
/>
-
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1, transition: { duration: 0.2 } }}
@@ -249,7 +248,6 @@ const Cardheader = (cartCount) => {
</p>
</Link>
)}
-
{product?.hasFlashsale && (
<div className='flex gap-x-1 items-center mb-2 mt-1'>
<div className='badge-solid-red'>
@@ -371,7 +369,6 @@ const Cardheader = (cartCount) => {
</>
)}
</AnimatePresence>
-
</div>
)
}