From 8efe9fb6dd906431dcaed1818aae07692aeaa094 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 4 Feb 2025 15:16:37 +0700 Subject: update logic switch account --- src/pages/my/profile.jsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index eaf3341c..77c108cb 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -108,18 +108,19 @@ export default function Profile() {
- {!auth?.parentId && !ubahAkun && ( -
- -

Ubah ke akun bisnis

-
- )} + {auth?.company || + (!ubahAkun && ( +
+ +

Ubah ke akun bisnis

+
+ ))} {isChecked && (
-- cgit v1.2.3 From 5187f40005dd2e391ae601c11886b539dffe4dd7 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 4 Feb 2025 15:19:14 +0700 Subject: update mobile --- src/pages/my/profile.jsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 77c108cb..54e9024a 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -71,18 +71,19 @@ export default function Profile() { - {!auth?.parentId && !ubahAkun && ( -
- -

Ubah ke akun bisnis

-
- )} + {auth?.company || + (!ubahAkun && ( +
+ +

Ubah ke akun bisnis

+
+ ))} {isChecked && (
-- cgit v1.2.3 From 7dd2b66958fbe63c1fa68a9c3fb5eab7ee389342 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 4 Feb 2025 17:02:17 +0700 Subject: munculin company profile --- 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 54e9024a..859b6960 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -98,7 +98,7 @@ export default function Profile() { )} */} - {auth?.parentId && } + {(auth?.parentId || auth?.company) && } @@ -136,7 +136,7 @@ export default function Profile() { )} */} - {auth?.parentId && } + {(auth?.parentId || auth?.company) && }
-- cgit v1.2.3 From 95322b2c473da6160af0e3d685ec3d5eb924df05 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 21 Feb 2025 15:02:27 +0700 Subject: update code /my/tempo --- src/pages/my/tempo/index.jsx | 54 +++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx index 5fb9deba..6ca5c718 100644 --- a/src/pages/my/tempo/index.jsx +++ b/src/pages/my/tempo/index.jsx @@ -13,39 +13,41 @@ export default function MyTempo() { const router = useRouter(); const [isLoading, setIsLoading] = useState(true); useEffect(() => { + setIsLoading(true); 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.partnerTempo && + (!auth.partnerTempo || auth.tempoProgres === 'review') + ) { + setIsLoading(true); + router.push('/pengajuan-tempo'); + } setIsLoading(false); } }, [auth]); - if (isLoading || !auth) { - return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia - } - return ( - - + if (isLoading && !auth) { + return null; + } else { + return ( + + - - - - - + + + + + - - - - - - - ); + + + + + + + ); + } } -- cgit v1.2.3