From 016cbe790dd698ee258f17c8218ef6fdc667ad0d Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 27 Sep 2024 17:00:00 +0700
Subject: <iman> update switch account

---
 src/lib/auth/components/Menu.jsx | 187 ++++++++++++++++++++++++++-------------
 1 file changed, 124 insertions(+), 63 deletions(-)

(limited to 'src/lib/auth/components/Menu.jsx')

diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index f475db1f..ddbb0760 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -1,76 +1,137 @@
-import Link from '@/core/components/elements/Link/Link'
-import { useRouter } from 'next/router'
-import ImageNext from 'next/image'
-import whatsappUrl from '@/core/utils/whatsappUrl'
+import Link from '@/core/components/elements/Link/Link';
+import { useRouter } from 'next/router';
+import ImageNext from 'next/image';
+import whatsappUrl from '@/core/utils/whatsappUrl';
+import useAuth from '@/core/hooks/useAuth';
+import Divider from '@/core/components/elements/Divider/Divider';
 
 const Menu = () => {
-  const router = useRouter()
-
-  const routeStartWith = (route) => router.pathname.startsWith(route)
-
+  const router = useRouter();
+  const auth = useAuth();
+  const routeStartWith = (route) => router.pathname.startsWith(route);
   return (
     <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4 sticky top-48'>
-      <div className='mt-4 mb-1 font-medium'>Menu</div>
-      <LinkItem href='/my/quotations' active={routeStartWith('/my/quotations')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_daftar_quotation.svg' width={18} height={20} />
-          <p>Daftar Quotation</p>
-        </div>
-      </LinkItem>
-      <LinkItem href='/my/transactions' active={routeStartWith('/my/transactions')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_daftar_transaksi.svg' width={18} height={20} />
-          <p>Daftar Transaksi</p>
-        </div>
-      </LinkItem>
-      <LinkItem href='/my/shipments' active={routeStartWith('/my/shipments')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_pengiriman.svg' width={18} height={20} />
-          <p>Daftar Pengiriman</p>
-        </div>
-      </LinkItem>
-      <LinkItem href='/my/invoices' active={routeStartWith('/my/invoices')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_invoice.svg' width={18} height={20} />
-          <p>Invoice & Faktur Pajak</p>
-        </div>
-      </LinkItem>
-      <LinkItem href='/my/wishlist' active={routeStartWith('/my/wishlist')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_wishlist.svg' width={18} height={20} />
-          <p>Wishlist</p>
-        </div>
-      </LinkItem>
+      <div className='flex justify-between py-4'>
+        <div className='font-semibold text-gray_r-12'>Akun Saya</div>
+        {auth?.company && (
+          <div className='badge-solid-red mt-1 p-2'>Akun Bisnis</div>
+        )}
+        {!auth?.company && (
+          <div className='badge-gray mt-1 p-2'>Akun Individu</div>
+        )}
+      </div>
+      <div className='mt-2 mb-1 font-medium'>Menu</div>
+      <div className='flex flex-col gap-y-2'>
+        <LinkItem
+          href='/my/quotations'
+          active={routeStartWith('/my/quotations')}
+          className=''
+        >
+          <div className='flex gap-x-3  items-center'>
+            <ImageNext
+              src='/images/icon/icon_daftar_quotation.svg'
+              width={18}
+              height={20}
+            />
+            <p>Daftar Quotation</p>
+          </div>
+        </LinkItem>
+        <LinkItem
+          href='/my/transactions'
+          active={routeStartWith('/my/transactions')}
+        >
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_daftar_transaksi.svg'
+              width={18}
+              height={20}
+            />
+            <p>Daftar Transaksi</p>
+          </div>
+        </LinkItem>
+        <LinkItem href='/my/shipments' active={routeStartWith('/my/shipments')}>
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_pengiriman.svg'
+              width={18}
+              height={20}
+            />
+            <p>Daftar Pengiriman</p>
+          </div>
+        </LinkItem>
+        <LinkItem href='/my/invoices' active={routeStartWith('/my/invoices')}>
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_invoice.svg'
+              width={18}
+              height={20}
+            />
+            <p>Invoice & Faktur Pajak</p>
+          </div>
+        </LinkItem>
+        <LinkItem href='/my/wishlist' active={routeStartWith('/my/wishlist')}>
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_wishlist.svg'
+              width={18}
+              height={20}
+            />
+            <p>Wishlist</p>
+          </div>
+        </LinkItem>
+      </div>
       <div className='mt-4 mb-1 font-medium'>Pusat Bantuan</div>
 
-      <LinkItem href={whatsappUrl('', '', '')} rel='noopener noreferrer' target='_blank'>
+      <LinkItem
+        href={whatsappUrl('', '', '')}
+        rel='noopener noreferrer'
+        target='_blank'
+      >
         <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_layanan_pelanggan.svg' width={18} height={20} />
+          <ImageNext
+            src='/images/icon/icon_layanan_pelanggan.svg'
+            width={18}
+            height={20}
+          />
           <p>Layanan Pelanggan</p>
         </div>
       </LinkItem>
       <div className='mt-4 mb-1 font-medium'>Pengaturan Akun</div>
-      <LinkItem href='/my/address' active={routeStartWith('/my/address')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_daftar_alamat.svg' width={18} height={20} />
-          <p>Daftar Alamat</p>
-        </div>
-      </LinkItem>
-      <LinkItem href='/my/profile' active={routeStartWith('/my/profile')}>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_profile.svg' width={18} height={20} />
-          <p>Profil Saya</p>
-        </div>
-      </LinkItem>
-      <button type='button' className='text-gray_r-12/80 p-2 text-left'>
-        <div className='flex gap-x-3 items-center'>
-          <ImageNext src='/images/icon/icon_logout.svg' width={18} height={20} />
-          <p>Keluar Akun</p>
-        </div>
-      </button>
+      <div className='flex flex-col gap-y-2'>
+        <LinkItem href='/my/address' active={routeStartWith('/my/address')}>
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_daftar_alamat.svg'
+              width={18}
+              height={20}
+            />
+            <p>Daftar Alamat</p>
+          </div>
+        </LinkItem>
+        <LinkItem href='/my/profile' active={routeStartWith('/my/profile')}>
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_profile.svg'
+              width={18}
+              height={20}
+            />
+            <p>Profil Saya</p>
+          </div>
+        </LinkItem>
+        <button type='button' className='text-gray_r-12/80 p-2 text-left'>
+          <div className='flex gap-x-3 items-center'>
+            <ImageNext
+              src='/images/icon/icon_logout.svg'
+              width={18}
+              height={20}
+            />
+            <p>Keluar Akun</p>
+          </div>
+        </button>
+      </div>
     </div>
-  )
-}
+  );
+};
 
 const LinkItem = ({ children, ...props }) => (
   <Link
@@ -81,6 +142,6 @@ const LinkItem = ({ children, ...props }) => (
   >
     {children}
   </Link>
-)
+);
 
-export default Menu
+export default Menu;
-- 
cgit v1.2.3


From 6de06f74f0a004900ecc415b91eb03d1b58a872f Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 28 Sep 2024 08:57:08 +0700
Subject: <iman> add hover

---
 src/lib/auth/components/Menu.jsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'src/lib/auth/components/Menu.jsx')

diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index ddbb0760..979de83b 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -118,7 +118,10 @@ const Menu = () => {
             <p>Profil Saya</p>
           </div>
         </LinkItem>
-        <button type='button' className='text-gray_r-12/80 p-2 text-left'>
+        <button
+          type='button'
+          className='text-gray_r-12/80 p-2 text-left hover:bg-gray_r-5 '
+        >
           <div className='flex gap-x-3 items-center'>
             <ImageNext
               src='/images/icon/icon_logout.svg'
@@ -136,8 +139,8 @@ const Menu = () => {
 const LinkItem = ({ children, ...props }) => (
   <Link
     {...props}
-    className={`!text-gray_r-12/80 !font-normal p-2 rounded ${
-      props.active == true ? 'bg-gray_r-3' : ''
+    className={`!text-gray_r-12/80 !font-normal p-2 rounded transition-colors duration-200 ${
+      props.active ? 'bg-gray_r-3' : 'hover:bg-gray_r-5 '
     }`}
   >
     {children}
-- 
cgit v1.2.3


From 3eb78e21b89bd0bdddb803767ea6ec983794994b Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 28 Sep 2024 10:01:30 +0700
Subject: <iman> update temp switch account

---
 src/lib/auth/components/Menu.jsx | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

(limited to 'src/lib/auth/components/Menu.jsx')

diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index 979de83b..042b1842 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -3,20 +3,36 @@ import { useRouter } from 'next/router';
 import ImageNext from 'next/image';
 import whatsappUrl from '@/core/utils/whatsappUrl';
 import useAuth from '@/core/hooks/useAuth';
-import Divider from '@/core/components/elements/Divider/Divider';
+import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js';
+import { useState, useEffect } from 'react';
 
 const Menu = () => {
   const router = useRouter();
   const auth = useAuth();
+  // console.log('auth', auth);
+  const [ubahAkun, setUbahAkun] = useState();
+  // const [isAprove, setIsAprove] = useState();
+  useEffect(() => {
+    const loadProgres = async () => {
+      const progresSwitchAccount = await switchAccountProgresApi();
+      console.log('progresSwitchAccount', progresSwitchAccount);
+      // if (progresSwitchAccount) {
+      // setIsAprove(progresSwitchAccount.status);
+      setUbahAkun(progresSwitchAccount.status);
+      // }
+    };
+    loadProgres();
+  }, []);
   const routeStartWith = (route) => router.pathname.startsWith(route);
   return (
     <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4 sticky top-48'>
       <div className='flex justify-between py-4'>
         <div className='font-semibold text-gray_r-12'>Akun Saya</div>
-        {auth?.company && (
+        {auth?.company && !ubahAkun && (
           <div className='badge-solid-red mt-1 p-2'>Akun Bisnis</div>
         )}
-        {!auth?.company && (
+        {ubahAkun && <div className='badge-solid-red mt-1 p-2'>Review</div>}
+        {!auth?.company && !ubahAkun && (
           <div className='badge-gray mt-1 p-2'>Akun Individu</div>
         )}
       </div>
-- 
cgit v1.2.3


From fc50a4ebcb3a11dd1059be6282122677499175f7 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 28 Sep 2024 10:32:53 +0700
Subject: <iman> update switch account

---
 src/lib/auth/components/Menu.jsx | 52 +++++++++++++++++++++++++++++-----------
 1 file changed, 38 insertions(+), 14 deletions(-)

(limited to 'src/lib/auth/components/Menu.jsx')

diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index 042b1842..06eb6c2d 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -5,21 +5,18 @@ import whatsappUrl from '@/core/utils/whatsappUrl';
 import useAuth from '@/core/hooks/useAuth';
 import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js';
 import { useState, useEffect } from 'react';
+import { InfoIcon } from 'lucide-react';
 
 const Menu = () => {
   const router = useRouter();
   const auth = useAuth();
-  // console.log('auth', auth);
   const [ubahAkun, setUbahAkun] = useState();
-  // const [isAprove, setIsAprove] = useState();
   useEffect(() => {
     const loadProgres = async () => {
       const progresSwitchAccount = await switchAccountProgresApi();
-      console.log('progresSwitchAccount', progresSwitchAccount);
-      // if (progresSwitchAccount) {
-      // setIsAprove(progresSwitchAccount.status);
-      setUbahAkun(progresSwitchAccount.status);
-      // }
+      if (progresSwitchAccount) {
+        setUbahAkun(progresSwitchAccount.status);
+      }
     };
     loadProgres();
   }, []);
@@ -28,13 +25,40 @@ const Menu = () => {
     <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4 sticky top-48'>
       <div className='flex justify-between py-4'>
         <div className='font-semibold text-gray_r-12'>Akun Saya</div>
-        {auth?.company && !ubahAkun && (
-          <div className='badge-solid-red mt-1 p-2'>Akun Bisnis</div>
-        )}
-        {ubahAkun && <div className='badge-solid-red mt-1 p-2'>Review</div>}
-        {!auth?.company && !ubahAkun && (
-          <div className='badge-gray mt-1 p-2'>Akun Individu</div>
-        )}
+        <div className='relative group'>
+          {auth?.company && !(ubahAkun === 'pending') && (
+            <>
+              <div className='badge-solid-red mt-1 p-2 flex flex-row items-center gap-x-2'>
+                <p>Akun Bisnis</p> <InfoIcon size={14} />
+              </div>
+              <div className='absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2 w-24'>
+                Ini adalah akun bisnis.
+              </div>
+            </>
+          )}
+          {ubahAkun === 'pending' && (
+            <>
+              <div className='badge-yellow mt-1 p-2 flex flex-row items-center gap-x-2'>
+                <p>Review</p>
+                <InfoIcon size={14} />
+              </div>
+              <div className='absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2'>
+                Akun sedang dalam proses review.
+              </div>
+            </>
+          )}
+          {!auth?.company && !(ubahAkun === 'pending') && (
+            <>
+              <div className='badge-gray mt-1 p-2 flex flex-row items-center gap-x-2'>
+                <p>Akun Individu</p>
+                <InfoIcon size={14} />
+              </div>
+              <div className='absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2'>
+                Ini adalah akun individu.
+              </div>
+            </>
+          )}
+        </div>
       </div>
       <div className='mt-2 mb-1 font-medium'>Menu</div>
       <div className='flex flex-col gap-y-2'>
-- 
cgit v1.2.3


From 2a030239105dba1f78a3fdc51ccc49a46bc60ca2 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 30 Sep 2024 13:57:59 +0700
Subject: <iman> update switch account

---
 src/lib/auth/components/Menu.jsx | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

(limited to 'src/lib/auth/components/Menu.jsx')

diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index 06eb6c2d..8eaa769b 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -31,8 +31,9 @@ const Menu = () => {
               <div className='badge-solid-red mt-1 p-2 flex flex-row items-center gap-x-2'>
                 <p>Akun Bisnis</p> <InfoIcon size={14} />
               </div>
-              <div className='absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2 w-24'>
-                Ini adalah akun bisnis.
+              <div className='absolute bottom-full transform -translate-x-1/2 mb-2 hidden  group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2 w-72 text-justify left-36'>
+                Anda terdaftar sebagai akun bisnis, segala bentuk transaksi anda
+                untuk perusahaan yang sudah anda daftarkan di Indoteknik.com
               </div>
             </>
           )}
@@ -42,8 +43,9 @@ const Menu = () => {
                 <p>Review</p>
                 <InfoIcon size={14} />
               </div>
-              <div className='absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2'>
-                Akun sedang dalam proses review.
+              <div className='absolute bottom-full transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2 w-72 text-justify left-36'>
+                Proses perubahan akun anda sedang kami review, mohon menunggu
+                hingga 2x24 jam.
               </div>
             </>
           )}
@@ -53,8 +55,11 @@ const Menu = () => {
                 <p>Akun Individu</p>
                 <InfoIcon size={14} />
               </div>
-              <div className='absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2'>
-                Ini adalah akun individu.
+              <div className='absolute bottom-full left-36 transform -translate-x-1/2 mb-3 w-72 text-justify hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2'>
+                <p className='whitespace-pre-wrap break-words'>
+                  Anda terdaftar sebagai akun individu, Segala bentuk transaksi
+                  anda untuk Pribadi/Individu.
+                </p>
               </div>
             </>
           )}
-- 
cgit v1.2.3


From dbc533f88854555af8f1ba031b1640836c903183 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 1 Oct 2024 09:23:29 +0700
Subject: <iman> update badge click to my profile

---
 src/lib/auth/components/Menu.jsx | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

(limited to 'src/lib/auth/components/Menu.jsx')

diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index 8eaa769b..7b766968 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -28,9 +28,13 @@ const Menu = () => {
         <div className='relative group'>
           {auth?.company && !(ubahAkun === 'pending') && (
             <>
-              <div className='badge-solid-red mt-1 p-2 flex flex-row items-center gap-x-2'>
-                <p>Akun Bisnis</p> <InfoIcon size={14} />
-              </div>
+              <Link
+                href='/my/profile'
+                className='badge-solid-red mt-1 p-2 flex flex-row items-center gap-x-2'
+              >
+                <p className='text-white'>Akun Bisnis</p>{' '}
+                <InfoIcon size={14} color='white' />
+              </Link>
               <div className='absolute bottom-full transform -translate-x-1/2 mb-2 hidden  group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2 w-72 text-justify left-36'>
                 Anda terdaftar sebagai akun bisnis, segala bentuk transaksi anda
                 untuk perusahaan yang sudah anda daftarkan di Indoteknik.com
@@ -39,10 +43,13 @@ const Menu = () => {
           )}
           {ubahAkun === 'pending' && (
             <>
-              <div className='badge-yellow mt-1 p-2 flex flex-row items-center gap-x-2'>
-                <p>Review</p>
-                <InfoIcon size={14} />
-              </div>
+              <Link
+                href='/my/profile'
+                className='badge-yellow mt-1 p-2 flex flex-row items-center gap-x-2'
+              >
+                <p className='text-warning-900'>Review</p>
+                <InfoIcon size={14} className='text-warning-900' />
+              </Link>
               <div className='absolute bottom-full transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2 w-72 text-justify left-36'>
                 Proses perubahan akun anda sedang kami review, mohon menunggu
                 hingga 2x24 jam.
@@ -51,10 +58,13 @@ const Menu = () => {
           )}
           {!auth?.company && !(ubahAkun === 'pending') && (
             <>
-              <div className='badge-gray mt-1 p-2 flex flex-row items-center gap-x-2'>
-                <p>Akun Individu</p>
-                <InfoIcon size={14} />
-              </div>
+              <Link
+                href='/my/profile'
+                className='badge-gray mt-1 p-2 flex flex-row items-center gap-x-2'
+              >
+                <p className='text-gray_r-10'>Akun Individu</p>
+                <InfoIcon size={14} className='text-gray_r-10' />
+              </Link>
               <div className='absolute bottom-full left-36 transform -translate-x-1/2 mb-3 w-72 text-justify hidden group-hover:block bg-gray-700 text-white text-xs rounded py-1 px-2'>
                 <p className='whitespace-pre-wrap break-words'>
                   Anda terdaftar sebagai akun individu, Segala bentuk transaksi
-- 
cgit v1.2.3

