diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-01-14 09:53:43 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-01-14 09:53:43 +0000 |
| commit | 3e037c57566d7fb0acad2cb71fedd075cb9ce462 (patch) | |
| tree | 1ec2ebdf700d3c9501a665a8f1e5351ddc80e5ef /src/pages/my | |
| parent | a868498e7327593b40d1e02fd96531fefd9548d5 (diff) | |
| parent | 76afb8aaa5d2aaaf68529e11e9ed4d003d953f76 (diff) | |
Merged in Feature/pengajuan-tempo (pull request #401)
Feature/pengajuan tempo
Approved-by: trisusilo
Diffstat (limited to 'src/pages/my')
| -rw-r--r-- | src/pages/my/menu.jsx | 13 | ||||
| -rw-r--r-- | src/pages/my/tempo/index.jsx | 49 |
2 files changed, 62 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..a1897e51 --- /dev/null +++ b/src/pages/my/tempo/index.jsx @@ -0,0 +1,49 @@ +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> + ); +} |
