From 34f33b1cba1e4fbb6faacc151a3b59a1ba221d60 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 10 Sep 2024 16:26:17 +0700 Subject: add feature switch account --- src/pages/my/profile.jsx | 68 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 22 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 25c3a608..ca6f4700 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -1,16 +1,23 @@ -import Divider from '@/core/components/elements/Divider/Divider' -import AppLayout from '@/core/components/layouts/AppLayout' -import BasicLayout from '@/core/components/layouts/BasicLayout' -import DesktopView from '@/core/components/views/DesktopView' -import MobileView from '@/core/components/views/MobileView' -import useAuth from '@/core/hooks/useAuth' -import CompanyProfile from '@/lib/auth/components/CompanyProfile' -import IsAuth from '@/lib/auth/components/IsAuth' -import Menu from '@/lib/auth/components/Menu' -import PersonalProfile from '@/lib/auth/components/PersonalProfile' +import Divider from '@/core/components/elements/Divider/Divider'; +import AppLayout from '@/core/components/layouts/AppLayout'; +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import DesktopView from '@/core/components/views/DesktopView'; +import MobileView from '@/core/components/views/MobileView'; +import useAuth from '@/core/hooks/useAuth'; +import CompanyProfile from '@/lib/auth/components/CompanyProfile'; +import SwitchAccount from '@/lib/auth/components/SwitchAccount'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import Menu from '@/lib/auth/components/Menu'; +import PersonalProfile from '@/lib/auth/components/PersonalProfile'; +import { Button, Checkbox, Spinner, Tooltip } from '@chakra-ui/react'; +import { useState } from 'react'; export default function Profile() { - const auth = useAuth() + const auth = useAuth(); + const [isChecked, setIsChecked] = useState(false); + const handleChange = async () => { + setIsChecked(!isChecked); + }; return ( @@ -23,19 +30,36 @@ export default function Profile() { -
-
- -
-
- - - {auth?.parentId && } - -
+
+
+ +
+
+ {!auth?.parentId && ( +
+ +

Ubah ke akun bisnis

+
+ )} + {isChecked && ( +
+ + +
+ )} + + + {auth?.parentId && } +
- ) + ); } -- cgit v1.2.3 From 752e55686dfee0d536f9e4e128336e91681ba794 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 11 Sep 2024 17:07:49 +0700 Subject: update switch account --- src/pages/my/profile.jsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index ca6f4700..c9742a14 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -10,14 +10,25 @@ import IsAuth from '@/lib/auth/components/IsAuth'; import Menu from '@/lib/auth/components/Menu'; import PersonalProfile from '@/lib/auth/components/PersonalProfile'; import { Button, Checkbox, Spinner, Tooltip } from '@chakra-ui/react'; -import { useState } from 'react'; - +import { useState, useEffect } from 'react'; +import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); + const [isAprove, setIsAprove] = useState(false); const handleChange = async () => { setIsChecked(!isChecked); }; + useEffect(() => { + const loadPromo = async () => { + const progresSwitchAccount = await switchAccountProgresApi(); + if (progresSwitchAccount) { + setIsAprove(true); + } + console.log('progresSwitchAccount', progresSwitchAccount); + }; + loadPromo(); + }, []); return ( @@ -35,7 +46,7 @@ export default function Profile() {
- {!auth?.parentId && ( + {!auth?.parentId && !isAprove && (
Date: Thu, 12 Sep 2024 10:11:02 +0700 Subject: update switch account --- src/pages/my/profile.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index c9742a14..4beaae5f 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -9,13 +9,14 @@ import SwitchAccount from '@/lib/auth/components/SwitchAccount'; import IsAuth from '@/lib/auth/components/IsAuth'; import Menu from '@/lib/auth/components/Menu'; import PersonalProfile from '@/lib/auth/components/PersonalProfile'; +import StatusSwitchAccount from '@/lib/auth/components/StatusSwitchAccount'; import { Button, Checkbox, Spinner, Tooltip } from '@chakra-ui/react'; import { useState, useEffect } from 'react'; import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); - const [isAprove, setIsAprove] = useState(false); + const [isAprove, setIsAprove] = useState('unknown'); const handleChange = async () => { setIsChecked(!isChecked); }; @@ -23,12 +24,13 @@ export default function Profile() { const loadPromo = async () => { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { - setIsAprove(true); + setIsAprove(progresSwitchAccount.status); } console.log('progresSwitchAccount', progresSwitchAccount); }; loadPromo(); }, []); + console.log('isAprove', isAprove); return ( @@ -46,7 +48,7 @@ export default function Profile() {
- {!auth?.parentId && !isAprove && ( + {!auth?.parentId && isAprove == 'unknown' && (
)} + {!auth?.parentId + ? auth?.parentId + : auth?.parent_id && + isAprove != 'unknown' && ( + + )} {auth?.parentId && } -- cgit v1.2.3 From f0f002ff77481db91d264069d09f580d58001a8c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 23 Sep 2024 13:15:02 +0700 Subject: update switch account --- src/pages/my/profile.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 4beaae5f..13cab06d 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -16,6 +16,7 @@ import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); + const [ubahAkun, setUbahAkun] = useState(false); const [isAprove, setIsAprove] = useState('unknown'); const handleChange = async () => { setIsChecked(!isChecked); @@ -25,6 +26,7 @@ export default function Profile() { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(progresSwitchAccount.status); + setUbahAkun(progresSwitchAccount.status === 'unknown'); } console.log('progresSwitchAccount', progresSwitchAccount); }; @@ -48,7 +50,7 @@ export default function Profile() {
- {!auth?.parentId && isAprove == 'unknown' && ( + {!auth?.parentId && ubahAkun && (
Date: Mon, 23 Sep 2024 14:17:52 +0700 Subject: delete console.log --- src/pages/my/profile.jsx | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 13cab06d..0eeec6cf 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -28,11 +28,9 @@ export default function Profile() { setIsAprove(progresSwitchAccount.status); setUbahAkun(progresSwitchAccount.status === 'unknown'); } - console.log('progresSwitchAccount', progresSwitchAccount); }; loadPromo(); }, []); - console.log('isAprove', isAprove); return ( -- cgit v1.2.3 From c0a72c10864ee5e70ebfba4718be25eba910ccf0 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 23 Sep 2024 16:13:10 +0700 Subject: update mobile view --- src/pages/my/profile.jsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 0eeec6cf..b87aa69a 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -35,6 +35,30 @@ export default function Profile() { + {!auth?.parentId && ubahAkun && ( +
+ +

Ubah ke akun bisnis

+
+ )} + {isChecked && ( +
+ + +
+ )} + {!auth?.parentId + ? auth?.parentId + : auth?.parent_id && + isAprove != 'unknown' && ( + + )} {auth?.parentId && } -- cgit v1.2.3 From 461d2786935c5c9b3cf627c44fc06fcd1c3e8075 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 26 Sep 2024 11:13:15 +0700 Subject: add pop up yakin ubah type akun --- src/pages/my/profile.jsx | 181 ++++++++++++++++++++++++++++------------------- 1 file changed, 109 insertions(+), 72 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index b87aa69a..f6063ff2 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -10,16 +10,22 @@ import IsAuth from '@/lib/auth/components/IsAuth'; import Menu from '@/lib/auth/components/Menu'; import PersonalProfile from '@/lib/auth/components/PersonalProfile'; import StatusSwitchAccount from '@/lib/auth/components/StatusSwitchAccount'; -import { Button, Checkbox, Spinner, Tooltip } from '@chakra-ui/react'; +import { Checkbox } from '@chakra-ui/react'; import { useState, useEffect } from 'react'; import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; +import BottomPopup from '@/core/components/elements/Popup/BottomPopup'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); const [ubahAkun, setUbahAkun] = useState(false); const [isAprove, setIsAprove] = useState('unknown'); + const [changeConfirmation, setChangeConfirmation] = useState(false); const handleChange = async () => { - setIsChecked(!isChecked); + if (isChecked) { + setIsChecked(!isChecked); + } else { + setChangeConfirmation(true); + } }; useEffect(() => { const loadPromo = async () => { @@ -31,78 +37,109 @@ export default function Profile() { }; loadPromo(); }, []); + const handleConfirmSubmit = () => { + setChangeConfirmation(false); + setIsChecked(true); + }; return ( - - - - {!auth?.parentId && ubahAkun && ( -
- -

Ubah ke akun bisnis

-
- )} - {isChecked && ( -
- - -
- )} - {!auth?.parentId - ? auth?.parentId - : auth?.parent_id && - isAprove != 'unknown' && ( - - )} - - - {auth?.parentId && } -
-
+ <> + setChangeConfirmation(false)} // Menutup popup + title='Ubah type akun' + > +
+ Anda akan mengubah type akun anda? +
+
+ + +
+
+ + + + {!auth?.parentId && ubahAkun && ( +
+ +

Ubah ke akun bisnis

+
+ )} + {isChecked && ( +
+ + +
+ )} + {!auth?.parentId + ? auth?.parentId + : auth?.parent_id && + isAprove != 'unknown' && ( + + )} + + + {auth?.parentId && } +
+
- - -
-
- -
-
- {!auth?.parentId && ubahAkun && ( -
- -

Ubah ke akun bisnis

-
- )} - {isChecked && ( -
- - -
- )} - {!auth?.parentId - ? auth?.parentId - : auth?.parent_id && - isAprove != 'unknown' && ( - - )} - - - {auth?.parentId && } + + +
+
+ +
+
+ {!auth?.parentId && ubahAkun && ( +
+ +

Ubah ke akun bisnis

+
+ )} + {isChecked && ( +
+ + +
+ )} + {!auth?.parentId + ? auth?.parentId + : auth?.parent_id && + isAprove != 'unknown' && ( + + )} + + + {auth?.parentId && } +
-
- - - + + + + ); } -- cgit v1.2.3 From 3eb78e21b89bd0bdddb803767ea6ec983794994b Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Sat, 28 Sep 2024 10:01:30 +0700 Subject: update temp switch account --- src/pages/my/profile.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index f6063ff2..ee0cd907 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -9,7 +9,7 @@ import SwitchAccount from '@/lib/auth/components/SwitchAccount'; import IsAuth from '@/lib/auth/components/IsAuth'; import Menu from '@/lib/auth/components/Menu'; import PersonalProfile from '@/lib/auth/components/PersonalProfile'; -import StatusSwitchAccount from '@/lib/auth/components/StatusSwitchAccount'; +// import StatusSwitchAccount from '@/lib/auth/components/StatusSwitchAccount'; import { Checkbox } from '@chakra-ui/react'; import { useState, useEffect } from 'react'; import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; @@ -89,12 +89,12 @@ export default function Profile() {
)} - {!auth?.parentId + {/* {!auth?.parentId ? auth?.parentId : auth?.parent_id && isAprove != 'unknown' && ( - )} + )} */} {auth?.parentId && } @@ -126,12 +126,12 @@ export default function Profile() {
)} - {!auth?.parentId + {/* {!auth?.parentId ? auth?.parentId : auth?.parent_id && isAprove != 'unknown' && ( - )} + )} */} {auth?.parentId && } -- cgit v1.2.3 From 2dc7f7ae3eb62f9821f8ae1fb87db2e7b9234e1b Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 1 Oct 2024 10:57:08 +0700 Subject: update logic switch account --- src/pages/my/profile.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index ee0cd907..f44a44f3 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -18,7 +18,7 @@ export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); const [ubahAkun, setUbahAkun] = useState(false); - const [isAprove, setIsAprove] = useState('unknown'); + const [isAprove, setIsAprove] = useState(); const [changeConfirmation, setChangeConfirmation] = useState(false); const handleChange = async () => { if (isChecked) { @@ -32,7 +32,7 @@ export default function Profile() { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(progresSwitchAccount.status); - setUbahAkun(progresSwitchAccount.status === 'unknown'); + setUbahAkun(progresSwitchAccount.status); } }; loadPromo(); @@ -71,7 +71,7 @@ export default function Profile() { - {!auth?.parentId && ubahAkun && ( + {!auth?.parentId && !ubahAkun && (
- {!auth?.parentId && ubahAkun && ( + {!auth?.parentId && !ubahAkun && (
Date: Wed, 2 Oct 2024 13:21:25 +0700 Subject: update switch account --- src/pages/my/profile.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index f44a44f3..eaf3341c 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -85,7 +85,7 @@ export default function Profile() { )} {isChecked && (
- +
)} @@ -122,7 +122,7 @@ export default function Profile() { )} {isChecked && (
- +
)} -- cgit v1.2.3 From 9622bff4d4902fcef81214236cc7ff035163e5e7 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 13 Nov 2024 16:46:14 +0700 Subject: pengajuan tempo --- src/pages/my/menu.jsx | 104 +++++++++++++++++++++++++++++++------------ src/pages/my/tempo/index.jsx | 27 +++++++++++ 2 files changed, 102 insertions(+), 29 deletions(-) create mode 100644 src/pages/my/tempo/index.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index a0ce223e..63b4d35c 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -1,24 +1,24 @@ -import Divider from '@/core/components/elements/Divider/Divider' -import Link from '@/core/components/elements/Link/Link' -import AppLayout from '@/core/components/layouts/AppLayout' -import useAuth from '@/core/hooks/useAuth' -import { deleteAuth } from '@/core/utils/auth' -import IsAuth from '@/lib/auth/components/IsAuth' -import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid' -import { signOut, useSession } from 'next-auth/react' -import { useRouter } from 'next/router' -import ImageNext from 'next/image' +import Divider from '@/core/components/elements/Divider/Divider'; +import Link from '@/core/components/elements/Link/Link'; +import AppLayout from '@/core/components/layouts/AppLayout'; +import useAuth from '@/core/hooks/useAuth'; +import { deleteAuth } from '@/core/utils/auth'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid'; +import { signOut, useSession } from 'next-auth/react'; +import { useRouter } from 'next/router'; +import ImageNext from 'next/image'; export default function Menu() { - const auth = useAuth() - const router = useRouter() - const { data: session } = useSession() + const auth = useAuth(); + const router = useRouter(); + const { data: session } = useSession(); const logout = () => { deleteAuth().then(() => { - router.push('/login') - }) - } + router.push('/login'); + }); + }; return ( @@ -29,8 +29,12 @@ export default function Menu() {
{auth?.name}
- {auth?.company &&
Akun Bisnis
} - {!auth?.company &&
Akun Individu
} + {auth?.company && ( +
Akun Bisnis
+ )} + {!auth?.company && ( +
Akun Individu
+ )}
@@ -47,32 +51,63 @@ export default function Menu() { {' '}
- +

Daftar Quotation

- +

Daftar Transaksi

- +

Daftar Pengiriman

{' '}
- +

Invoice & Faktur Pajak

+ + {' '} +
+ +

Pembayaran Tempo

+
+
- +

Wishlist

@@ -86,7 +121,11 @@ export default function Menu() { {' '}
- +

Layanan Pelanggan

@@ -99,7 +138,11 @@ export default function Menu() {
- +

Daftar Alamat

@@ -112,20 +155,23 @@ export default function Menu() {
- ) + ); } const MenuHeader = ({ children, ...props }) => (
{children}
-) +); const LinkItem = ({ children, ...props }) => ( - + {children}
-) +); diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx new file mode 100644 index 00000000..e540fbda --- /dev/null +++ b/src/pages/my/tempo/index.jsx @@ -0,0 +1,27 @@ +import Seo from '@/core/components/Seo'; +import AppLayout from '@/core/components/layouts/AppLayout'; +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import DesktopView from '@/core/components/views/DesktopView'; +import MobileView from '@/core/components/views/MobileView'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import InvoicesComponent from '@/lib/invoice/components/Invoices'; + +export default function MyTempo() { + return ( + + + + + + + + + + + + + + + + ); +} -- cgit v1.2.3 From f481bae4d28b770d85ca2340cff60acbec70d0ee Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 14 Nov 2024 09:45:15 +0700 Subject: --- src/pages/my/tempo/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/my') diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx index e540fbda..365986f4 100644 --- a/src/pages/my/tempo/index.jsx +++ b/src/pages/my/tempo/index.jsx @@ -4,7 +4,7 @@ import BasicLayout from '@/core/components/layouts/BasicLayout'; import DesktopView from '@/core/components/views/DesktopView'; import MobileView from '@/core/components/views/MobileView'; import IsAuth from '@/lib/auth/components/IsAuth'; -import InvoicesComponent from '@/lib/invoice/components/Invoices'; +import InvoicesComponent from '@/lib/tempo/components/Tempo'; export default function MyTempo() { return ( -- cgit v1.2.3 From 77f9843ad5072583cb1797d7ecf5ac80394bad3f Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 2 Dec 2024 09:31:44 +0700 Subject: pengajuan tempo --- src/pages/my/menu.jsx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 407e400f..4099a935 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -90,17 +90,20 @@ export default function Menu() {

Invoice & Faktur Pajak

- - {' '} -
- -

Pembayaran Tempo

-
-
+ {(atuh?.partnerTempo.toLowerCase().includes('tempo') || + atuh.tempoProgres == 'review') && ( + + {' '} +
+ +

Pembayaran Tempo

+
+
+ )}
Date: Mon, 16 Dec 2024 17:42:31 +0700 Subject: update code --- src/pages/my/menu.jsx | 4 ++-- src/pages/my/tempo/index.jsx | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 4099a935..b626be30 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -90,8 +90,8 @@ export default function Menu() {

Invoice & Faktur Pajak

- {(atuh?.partnerTempo.toLowerCase().includes('tempo') || - atuh.tempoProgres == 'review') && ( + {(auth?.partnerTempo?.toLowerCase().includes('tempo') || + auth?.tempoProgres == 'review') && ( {' '}
diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx index 365986f4..f52fe960 100644 --- a/src/pages/my/tempo/index.jsx +++ b/src/pages/my/tempo/index.jsx @@ -5,8 +5,27 @@ import DesktopView from '@/core/components/views/DesktopView'; import MobileView from '@/core/components/views/MobileView'; import IsAuth from '@/lib/auth/components/IsAuth'; import InvoicesComponent from '@/lib/tempo/components/Tempo'; - +import { getAuth } from '~/libs/auth'; +import { useRouter } from 'next/router'; +import { useEffect, useState } from 'react'; export default function MyTempo() { + const auth = getAuth(); + const router = useRouter(); + const [isLoading, setIsLoading] = useState(true); + useEffect(() => { + if (!auth) { + const nextUrl = encodeURIComponent(router.asPath); + router.push(`/login?next=${nextUrl}`); + } else if (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') { + router.push('/pengajuan-tempo'); + } else { + setIsLoading(false); + } + }, [auth]); + + if (isLoading || !auth) { + return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia + } return ( -- cgit v1.2.3 From 21999682d2d6193d1033015c4e45f436a958f643 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 7 Jan 2025 15:56:56 +0700 Subject: update --- src/pages/my/tempo/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pages/my') diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx index f52fe960..a1897e51 100644 --- a/src/pages/my/tempo/index.jsx +++ b/src/pages/my/tempo/index.jsx @@ -16,7 +16,10 @@ export default function MyTempo() { if (!auth) { const nextUrl = encodeURIComponent(router.asPath); router.push(`/login?next=${nextUrl}`); - } else if (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') { + } else if ( + (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') && + !auth.company + ) { router.push('/pengajuan-tempo'); } else { setIsLoading(false); -- cgit v1.2.3 From fedaceac3e41741c198c94fd20917c9572fa7ec1 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 10 Jan 2025 15:26:44 +0700 Subject: update tempo page mobile view --- src/pages/my/menu.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index b626be30..2a46d866 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -90,8 +90,7 @@ export default function Menu() {

Invoice & Faktur Pajak

- {(auth?.partnerTempo?.toLowerCase().includes('tempo') || - auth?.tempoProgres == 'review') && ( + {(auth?.partnerTempo || auth?.tempoProgres == 'review') && ( {' '}
-- cgit v1.2.3 From 7a14ed5ccdde86d0400d6aa02ac866317d4add63 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 15 Jan 2025 16:17:54 +0700 Subject: update menu pembayaran tempo logic --- src/pages/my/tempo/index.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx index a1897e51..5fb9deba 100644 --- a/src/pages/my/tempo/index.jsx +++ b/src/pages/my/tempo/index.jsx @@ -16,12 +16,14 @@ export default function MyTempo() { if (!auth) { const nextUrl = encodeURIComponent(router.asPath); router.push(`/login?next=${nextUrl}`); - } else if ( - (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') && - !auth.company - ) { - router.push('/pengajuan-tempo'); - } else { + } + // else if ( + // (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') && + // !auth.company + // ) { + // router.push('/pengajuan-tempo'); + // } + else { setIsLoading(false); } }, [auth]); -- cgit v1.2.3