summaryrefslogtreecommitdiff
path: root/src/core/components/elements/Navbar/NavbarMobile.jsx
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-07-24 08:35:11 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-07-24 08:35:11 +0000
commit5be5be868124e7d4b21ab2137f45006380e3d0a1 (patch)
treed7c4151eb2bf83b85cd0532d45dedd02aa06694e /src/core/components/elements/Navbar/NavbarMobile.jsx
parentbed971bc1265cd9b0e6f0c01dcb57bf4089c21f9 (diff)
parent2de322571bad7490baaf439fa2bb12124c646bb5 (diff)
Merged in CR/widget_WA (pull request #17)
CR/widget WA
Diffstat (limited to 'src/core/components/elements/Navbar/NavbarMobile.jsx')
-rw-r--r--src/core/components/elements/Navbar/NavbarMobile.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/components/elements/Navbar/NavbarMobile.jsx b/src/core/components/elements/Navbar/NavbarMobile.jsx
index b69e86e8..704e91b6 100644
--- a/src/core/components/elements/Navbar/NavbarMobile.jsx
+++ b/src/core/components/elements/Navbar/NavbarMobile.jsx
@@ -6,7 +6,7 @@ import useSidebar from '@/core/hooks/useSidebar'
import dynamic from 'next/dynamic'
import IndoteknikLogo from '@/images/logo.png'
import { useEffect, useState } from 'react'
-import { getCart } from '@/core/utils/cart'
+import { getCart, getCountCart } from '@/core/utils/cart'
import TopBanner from './TopBanner'
const Search = dynamic(() => import('./Search'))
@@ -18,7 +18,11 @@ const NavbarMobile = () => {
useEffect(() => {
const handleCartChange = () => {
- setCartCount(Object.keys(getCart()).length)
+ const cart = async () => {
+ const listCart = await getCountCart()
+ setCartCount(listCart)
+ }
+ cart()
}
handleCartChange()