summaryrefslogtreecommitdiff
path: root/src/pages/my/profile.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-11 17:07:49 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-11 17:07:49 +0700
commit752e55686dfee0d536f9e4e128336e91681ba794 (patch)
tree65ab321175aee5520857c9e80f44009bde356c44 /src/pages/my/profile.jsx
parentab39764b288b4d60923cc8cc6146ccdc1b4bfbac (diff)
<iman> update switch account
Diffstat (limited to 'src/pages/my/profile.jsx')
-rw-r--r--src/pages/my/profile.jsx17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx
index ca6f4700..c9742a14 100644
--- a/src/pages/my/profile.jsx
+++ b/src/pages/my/profile.jsx
@@ -10,14 +10,25 @@ 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';
-
+import { useState, useEffect } from 'react';
+import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js';
export default function Profile() {
const auth = useAuth();
const [isChecked, setIsChecked] = useState(false);
+ const [isAprove, setIsAprove] = useState(false);
const handleChange = async () => {
setIsChecked(!isChecked);
};
+ useEffect(() => {
+ const loadPromo = async () => {
+ const progresSwitchAccount = await switchAccountProgresApi();
+ if (progresSwitchAccount) {
+ setIsAprove(true);
+ }
+ console.log('progresSwitchAccount', progresSwitchAccount);
+ };
+ loadPromo();
+ }, []);
return (
<IsAuth>
<MobileView>
@@ -35,7 +46,7 @@ export default function Profile() {
<Menu />
</div>
<div className='w-9/12 bg-white border border-gray_r-6 rounded'>
- {!auth?.parentId && (
+ {!auth?.parentId && !isAprove && (
<div className='text-sm p-4 flex items-center'>
<Checkbox
borderColor='gray.600'