diff options
Diffstat (limited to 'src/core/components/elements/Navbar/NavbarDesktop.jsx')
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarDesktop.jsx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx index 2bee64f7..3aba55c9 100644 --- a/src/core/components/elements/Navbar/NavbarDesktop.jsx +++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx @@ -10,17 +10,14 @@ import DesktopView from '../../views/DesktopView' import dynamic from 'next/dynamic' import IndoteknikLogo from '@/images/logo.png' import Category from '@/lib/category/components/Category' -import { useContext, useEffect, useState } from 'react' +import { useCallback, useContext, useEffect, useState } from 'react' import useAuth from '@/core/hooks/useAuth' import NavbarUserDropdown from './NavbarUserDropdown' -import { getCountCart } from '@/core/utils/cart' +import { getCartApi, getCountCart } from '@/core/utils/cart' import whatsappUrl from '@/core/utils/whatsappUrl' import { useRouter } from 'next/router' import { getAuth, setAuth } from '@/core/utils/auth' import { createSlug, getIdFromSlug } from '@/core/utils/slug' -import productApi from '@/lib/product/api/productApi' -import { useSession } from 'next-auth/react' -import { AuthContext } from '@/pages/_app' import { TopBannerSkeleton } from '../Skeleton/TopBannerSkeleton' import { useProductContext } from '@/contexts/ProductContext' import Cardheader from '@/lib/cart/components/Cartheader' @@ -32,7 +29,6 @@ const TopBanner = dynamic(() => import('./TopBanner'), { const NavbarDesktop = () => { const [isOpenCategory, setIsOpenCategory] = useState(false) - const { authenticated } = useContext(AuthContext) const auth = useAuth() const [cartCount, setCartCount] = useState(0) @@ -44,7 +40,7 @@ const NavbarDesktop = () => { const router = useRouter() const { product } = useProductContext() - + useEffect(() => { if (router.pathname === '/shop/product/[slug]') { setPayloadWa({ |
