diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-10-01 10:57:08 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-10-01 10:57:08 +0700 |
| commit | 2dc7f7ae3eb62f9821f8ae1fb87db2e7b9234e1b (patch) | |
| tree | 845713b3aeadfb224036cb03762b4079edb63b8e | |
| parent | ed679c9b8ea85e8f181cf67465effc4b5ff1a7bc (diff) | |
<iman> update logic switch account
| -rw-r--r-- | src/lib/auth/components/SwitchAccount.jsx | 4 | ||||
| -rw-r--r-- | src/pages/my/profile.jsx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/auth/components/SwitchAccount.jsx b/src/lib/auth/components/SwitchAccount.jsx index a609d9e7..12d00890 100644 --- a/src/lib/auth/components/SwitchAccount.jsx +++ b/src/lib/auth/components/SwitchAccount.jsx @@ -233,11 +233,11 @@ const SwitchAccount = ({ company_type }) => { buttonSubmitClick={buttonSubmitClick} /> <div className='flex flex-row justify-end mt-4 '> - <div> + <div className='mr-4'> <button type='submit' onClick={() => setChangeConfirmation(true)} - className='btn-yellow w-full sm:w-fit sm:ml-auto mt-6 mr-2' + className='btn-yellow w-full sm:w-fit sm:ml-auto mt-6 mr-8 md:mr-4' > {mutation.isLoading ? 'Loading...' : 'Simpan Perubahan'} </button> diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index ee0cd907..f44a44f3 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -18,7 +18,7 @@ export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); const [ubahAkun, setUbahAkun] = useState(false); - const [isAprove, setIsAprove] = useState('unknown'); + const [isAprove, setIsAprove] = useState(); const [changeConfirmation, setChangeConfirmation] = useState(false); const handleChange = async () => { if (isChecked) { @@ -32,7 +32,7 @@ export default function Profile() { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(progresSwitchAccount.status); - setUbahAkun(progresSwitchAccount.status === 'unknown'); + setUbahAkun(progresSwitchAccount.status); } }; loadPromo(); @@ -71,7 +71,7 @@ export default function Profile() { <IsAuth> <MobileView> <AppLayout title='Akun Saya'> - {!auth?.parentId && ubahAkun && ( + {!auth?.parentId && !ubahAkun && ( <div className='text-sm p-4 flex items-center'> <Checkbox borderColor='gray.600' @@ -108,7 +108,7 @@ export default function Profile() { <Menu /> </div> <div className='w-9/12 bg-white border border-gray_r-6 rounded'> - {!auth?.parentId && ubahAkun && ( + {!auth?.parentId && !ubahAkun && ( <div className='text-sm p-4 flex items-center'> <Checkbox borderColor='gray.600' |
