summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/auth/components/SwitchAccount.jsx10
-rw-r--r--src/pages/my/profile.jsx24
2 files changed, 32 insertions, 2 deletions
diff --git a/src/lib/auth/components/SwitchAccount.jsx b/src/lib/auth/components/SwitchAccount.jsx
index e737ef6a..18c6076f 100644
--- a/src/lib/auth/components/SwitchAccount.jsx
+++ b/src/lib/auth/components/SwitchAccount.jsx
@@ -13,7 +13,9 @@ import { useRegisterStore } from '~/modules/register/stores/useRegisterStore.ts'
import { registerUser } from '~/services/auth';
import { useMutation } from 'react-query';
import { isValid } from 'zod';
+import useDevice from '@/core/hooks/useDevice';
const SwitchAccount = () => {
+ const { isDesktop, isMobile } = useDevice();
const auth = useAuth();
const [isOpen, setIsOpen] = useState(true);
const toggle = () => setIsOpen(!isOpen);
@@ -130,7 +132,11 @@ const SwitchAccount = () => {
onClick={toggle}
className='p-4 flex items-center text-left w-full'
>
- <div className='flex flex-row items-center bg-slate-50'>
+ <div
+ className={`flex ${
+ isDesktop ? 'flex-row' : 'flex-col gap-y-2'
+ } items-start justify-start bg-slate-50`}
+ >
<div className='flex font-semibold mr-2'>Informasi Bisnis</div>
<div className='text-red-500 text-xs'>
*Perubahan akun tidak dapat diubah kembali
@@ -176,7 +182,7 @@ const SwitchAccount = () => {
</RadioGroup>
</div>
<FormBisnis
- type='profil'
+ type={isDesktop ? 'profil' : 'bisnis'}
required={isTerdaftar}
isPKP={isPKP}
chekValid={notValid}
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() {
<IsAuth>
<MobileView>
<AppLayout title='Akun Saya'>
+ {!auth?.parentId && ubahAkun && (
+ <div className='text-sm p-4 flex items-center'>
+ <Checkbox
+ borderColor='gray.600'
+ colorScheme='red'
+ size='lg'
+ isChecked={isChecked}
+ onChange={handleChange}
+ />
+ <p className='ml-2'>Ubah ke akun bisnis</p>
+ </div>
+ )}
+ {isChecked && (
+ <div>
+ <SwitchAccount />
+ <Divider />
+ </div>
+ )}
+ {!auth?.parentId
+ ? auth?.parentId
+ : auth?.parent_id &&
+ isAprove != 'unknown' && (
+ <StatusSwitchAccount status={isAprove} />
+ )}
<PersonalProfile />
<Divider />
{auth?.parentId && <CompanyProfile />}