diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-23 16:13:10 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-23 16:13:10 +0700 |
| commit | c0a72c10864ee5e70ebfba4718be25eba910ccf0 (patch) | |
| tree | 81e7264957b943b00f36e45593653e0dfb848fb7 | |
| parent | f404f9801db1f234ae03ec9c9542ba5d4aa1bf46 (diff) | |
<iman> update mobile view
| -rw-r--r-- | src/lib/auth/components/SwitchAccount.jsx | 10 | ||||
| -rw-r--r-- | src/pages/my/profile.jsx | 24 |
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 />} |
