diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-10 16:26:17 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-10 16:26:17 +0700 |
| commit | 34f33b1cba1e4fbb6faacc151a3b59a1ba221d60 (patch) | |
| tree | a8c877bf4e1b1e5e83c32275302ce73544f8b2f3 /src/pages/my | |
| parent | 88e982cb95ec49fe96452317b6b06000a6700d70 (diff) | |
<iman>add feature switch account
Diffstat (limited to 'src/pages/my')
| -rw-r--r-- | src/pages/my/profile.jsx | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 25c3a608..ca6f4700 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -1,16 +1,23 @@ -import Divider from '@/core/components/elements/Divider/Divider' -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 useAuth from '@/core/hooks/useAuth' -import CompanyProfile from '@/lib/auth/components/CompanyProfile' -import IsAuth from '@/lib/auth/components/IsAuth' -import Menu from '@/lib/auth/components/Menu' -import PersonalProfile from '@/lib/auth/components/PersonalProfile' +import Divider from '@/core/components/elements/Divider/Divider'; +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 useAuth from '@/core/hooks/useAuth'; +import CompanyProfile from '@/lib/auth/components/CompanyProfile'; +import SwitchAccount from '@/lib/auth/components/SwitchAccount'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import Menu from '@/lib/auth/components/Menu'; +import PersonalProfile from '@/lib/auth/components/PersonalProfile'; +import { Button, Checkbox, Spinner, Tooltip } from '@chakra-ui/react'; +import { useState } from 'react'; export default function Profile() { - const auth = useAuth() + const auth = useAuth(); + const [isChecked, setIsChecked] = useState(false); + const handleChange = async () => { + setIsChecked(!isChecked); + }; return ( <IsAuth> <MobileView> @@ -23,19 +30,36 @@ export default function Profile() { <DesktopView> <BasicLayout> - <div className='container mx-auto flex py-10'> - <div className='w-3/12 pr-4'> - <Menu /> - </div> - <div className='w-9/12 bg-white border border-gray_r-6 rounded'> - <PersonalProfile /> - <Divider /> - {auth?.parentId && <CompanyProfile />} - - </div> + <div className='container mx-auto flex py-10'> + <div className='w-3/12 pr-4'> + <Menu /> + </div> + <div className='w-9/12 bg-white border border-gray_r-6 rounded'> + {!auth?.parentId && ( + <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> + )} + <PersonalProfile /> + <Divider /> + {auth?.parentId && <CompanyProfile />} + </div> </div> </BasicLayout> </DesktopView> </IsAuth> - ) + ); } |
