From 01e86fb4a54b801a9b8124455611c312e5de4af0 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Mon, 14 Aug 2023 15:04:45 +0700
Subject: google sign in

---
 src/core/components/elements/Navbar/NavbarDesktop.jsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/core/components/elements/Navbar/NavbarDesktop.jsx')

diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index ea4b03ae..c6575831 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -17,9 +17,10 @@ import { getCountCart } from '@/core/utils/cart'
 import TopBanner from './TopBanner'
 import whatsappUrl from '@/core/utils/whatsappUrl'
 import { useRouter } from 'next/router'
-import { getAuth } from '@/core/utils/auth'
+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'
 
 const Search = dynamic(() => import('./Search'))
 
@@ -33,7 +34,7 @@ const NavbarDesktop = () => {
   const [payloadWA, setPayloadWa] = useState(null)
 
   const router = useRouter()
-
+  
   useEffect(() => {
     const handleCartChange = () => {
       const cart = async () => {
-- 
cgit v1.2.3


From 9a33f3a391a402807cc5e7913b1a97e430a7aaa2 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 15 Aug 2023 15:16:38 +0700
Subject: sign in

---
 src/core/components/elements/Navbar/NavbarDesktop.jsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/core/components/elements/Navbar/NavbarDesktop.jsx')

diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index c6575831..06c15b73 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -10,7 +10,7 @@ import DesktopView from '../../views/DesktopView'
 import dynamic from 'next/dynamic'
 import IndoteknikLogo from '@/images/logo.png'
 import Category from '@/lib/category/components/Category'
-import { useEffect, useState } from 'react'
+import { useContext, useEffect, useState } from 'react'
 import useAuth from '@/core/hooks/useAuth'
 import NavbarUserDropdown from './NavbarUserDropdown'
 import { getCountCart } from '@/core/utils/cart'
@@ -21,11 +21,13 @@ 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'
 
 const Search = dynamic(() => import('./Search'))
 
 const NavbarDesktop = () => {
   const [isOpenCategory, setIsOpenCategory] = useState(false)
+  const {authenticated} = useContext(AuthContext)
   const auth = useAuth()
 
   const [cartCount, setCartCount] = useState(0)
@@ -177,7 +179,7 @@ const NavbarDesktop = () => {
             </div>
 
             <div className='w-3/12 flex gap-x-1 relative'>
-              {!auth && (
+              {!authenticated && (
                 <>
                   <Link
                     href='/login'
@@ -193,10 +195,10 @@ const NavbarDesktop = () => {
                   </Link>
                 </>
               )}
-              {auth && (
+              {authenticated && (
                 <>
                   <div href='/' className='navbar-user-dropdown-button'>
-                    <span>Halo, {auth?.name}</span>
+                    <span>Halo, {authenticated?.name}</span>
                     <div className='ml-auto'>
                       <ChevronDownIcon className='w-6' />
                     </div>
-- 
cgit v1.2.3


From f01f28a7eac76c6da5bf857bfc80fd347586ce7f Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 16 Aug 2023 09:39:47 +0700
Subject: register google

---
 src/core/components/elements/Navbar/NavbarDesktop.jsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/core/components/elements/Navbar/NavbarDesktop.jsx')

diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index 06c15b73..17aedeb6 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -179,7 +179,7 @@ const NavbarDesktop = () => {
             </div>
 
             <div className='w-3/12 flex gap-x-1 relative'>
-              {!authenticated && (
+              {!auth && (
                 <>
                   <Link
                     href='/login'
@@ -195,10 +195,10 @@ const NavbarDesktop = () => {
                   </Link>
                 </>
               )}
-              {authenticated && (
+              {auth && (
                 <>
                   <div href='/' className='navbar-user-dropdown-button'>
-                    <span>Halo, {authenticated?.name}</span>
+                    <span>Halo, {auth?.name}</span>
                     <div className='ml-auto'>
                       <ChevronDownIcon className='w-6' />
                     </div>
-- 
cgit v1.2.3

