x
This commit is contained in:
1 parent
90915762c3
commit
36f8ff0759
1 file changed
+11
@@ -10,6 +10,17 @@ export default function CartDrawer() {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { isCartOpen, toggleCart, items, updateQuantity, removeFromCart, getCartTotal } = useCartStore()
|
const { isCartOpen, toggleCart, items, updateQuantity, removeFromCart, getCartTotal } = useCartStore()
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (isCartOpen) {
|
||||||
|
document.body.style.overflow = 'hidden'
|
||||||
|
} else {
|
||||||
|
document.body.style.overflow = ''
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
document.body.style.overflow = ''
|
||||||
|
}
|
||||||
|
}, [isCartOpen])
|
||||||
|
|
||||||
if (!isCartOpen) return null
|
if (!isCartOpen) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user