summaryrefslogtreecommitdiff
path: root/src/pages/my
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-15 16:29:48 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-15 16:29:48 +0700
commit98236a47c3558c4b701009a275c7ae917ee8bf67 (patch)
tree21e0300680a724c8a24ed815ea4e9a32ab13a895 /src/pages/my
parent1fa1a7873aa67cdd9ca211c239276a148cd4cdda (diff)
parent7a14ed5ccdde86d0400d6aa02ac866317d4add63 (diff)
Merge branch 'new-release' into Feature/switch-account
# Conflicts: # src/lib/auth/components/CompanyProfile.jsx # src/lib/auth/components/Menu.jsx
Diffstat (limited to 'src/pages/my')
-rw-r--r--src/pages/my/menu.jsx13
-rw-r--r--src/pages/my/tempo/index.jsx51
2 files changed, 64 insertions, 0 deletions
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index 1b35d6ba..2a46d866 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -90,6 +90,19 @@ export default function Menu() {
<p>Invoice & Faktur Pajak</p>
</div>
</LinkItem>
+ {(auth?.partnerTempo || auth?.tempoProgres == 'review') && (
+ <LinkItem href='/my/tempo'>
+ {' '}
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext
+ src='/images/icon/icon_tempo.svg'
+ width={18}
+ height={20}
+ />
+ <p>Pembayaran Tempo</p>
+ </div>
+ </LinkItem>
+ )}
<LinkItem href='/my/wishlist'>
<div className='flex gap-x-3 items-center'>
<ImageNext
diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
new file mode 100644
index 00000000..5fb9deba
--- /dev/null
+++ b/src/pages/my/tempo/index.jsx
@@ -0,0 +1,51 @@
+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/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') &&
+ // !auth.company
+ // ) {
+ // 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 (
+ <IsAuth>
+ <Seo title='Tempo - Indoteknik.com' />
+
+ <MobileView>
+ <AppLayout title='Pembayaran Tempo'>
+ <InvoicesComponent />
+ </AppLayout>
+ </MobileView>
+
+ <DesktopView>
+ <BasicLayout>
+ <InvoicesComponent />
+ </BasicLayout>
+ </DesktopView>
+ </IsAuth>
+ );
+}