ryoji-s 2 лет назад
Родитель
Сommit
7a6530aa79
1 измененных файлов с 4 добавлено и 7 удалено
  1. 4 7
      apps/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

+ 4 - 7
apps/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -39,8 +39,6 @@ import ShareLinkIcon from '../Icons/ShareLinkIcon';
 import { NotAvailable } from '../NotAvailable';
 import { Skeleton } from '../Skeleton';
 
-import { useOnPageEditorModeButtonClicked } from './hooks';
-
 import styles from './GrowiContextualSubNavigation.module.scss';
 import PageEditorModeManagerStyles from './PageEditorModeManager.module.scss';
 
@@ -238,12 +236,9 @@ const GrowiContextualSubNavigation = (props: GrowiContextualSubNavigationProps):
   // }, [pageId, mutatePageTagsForEditors, templateTagData, mutateSWRTagsInfo]);
 
   const [isPageTemplateModalShown, setIsPageTempleteModalShown] = useState(false);
-  const [isCreating, setIsCreating] = useState(false);
 
   const { isLinkSharingDisabled } = props;
 
-  const onPageEditorModeButtonClicked = useOnPageEditorModeButtonClicked(setIsCreating, path, grant, grantUserGroupId);
-
   // TODO: implement tags for editor
   // refs: https://redmine.weseek.co.jp/issues/132125
   // const tagsUpdatedHandlerForEditMode = useCallback((newTags: string[]): void => {
@@ -361,8 +356,10 @@ const GrowiContextualSubNavigation = (props: GrowiContextualSubNavigationProps):
         {isAbleToChangeEditorMode && (
           <PageEditorModeManager
             editorMode={editorMode}
-            isBtnDisabled={isCreating || !!isGuestUser || !!isReadOnlyUser}
-            onPageEditorModeButtonClicked={onPageEditorModeButtonClicked}
+            isBtnDisabled={!!isGuestUser || !!isReadOnlyUser}
+            path={path}
+            grant={grant}
+            grantUserGroupId={grantUserGroupId}
           />
         )}
       </div>