From 5982277bfcbd2f217da4509f45b032898da86900 Mon Sep 17 00:00:00 2001 From: wanghong Date: Mon, 23 Oct 2023 16:38:40 +0800 Subject: [PATCH] fix: remove useless hooks --- .../DefaultScene/hooks/useUserTypeHooks.tsx | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 packages/base/src/page/Home/DefaultScene/hooks/useUserTypeHooks.tsx diff --git a/packages/base/src/page/Home/DefaultScene/hooks/useUserTypeHooks.tsx b/packages/base/src/page/Home/DefaultScene/hooks/useUserTypeHooks.tsx deleted file mode 100644 index e94d062c4..000000000 --- a/packages/base/src/page/Home/DefaultScene/hooks/useUserTypeHooks.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { SystemRole } from '@actiontech/shared/lib/enum'; -import { useSelector, useDispatch } from 'react-redux'; -import { IReduxState } from '../../../../store'; -import { updateUserType } from '../../../../store/home'; - -const useUserTypeHooks = () => { - const dispatch = useDispatch(); - const userType = useSelector((state: IReduxState) => state.home.userType); - const onUserTypeChange = (type: string) => { - dispatch(updateUserType({ userType: type })); - }; - - const isAdmin = userType === SystemRole.admin; - - return { - isAdmin, - onUserTypeChange, - userType - }; -}; - -export default useUserTypeHooks;