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