소스 검색

refactor subnav props

Yuken Tezuka 3 년 전
부모
커밋
2f4f68b54d
2개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx
  2. 0 1
      packages/app/src/pages/[[...path]].page.tsx

+ 1 - 1
packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -184,7 +184,7 @@ const CreateTemplateMenuItems = (props: CreateTemplateMenuItemsProps): JSX.Eleme
 };
 
 type GrowiContextualSubNavigationProps = {
-  currentPage: IPagePopulatedToShowRevision,
+  currentPage?: IPagePopulatedToShowRevision | null,
   isCompactMode?: boolean,
   isLinkSharingDisabled: boolean,
 };

+ 0 - 1
packages/app/src/pages/[[...path]].page.tsx

@@ -140,7 +140,6 @@ type GrowiContextualSubNavigationProps = {
 const GrowiContextualSubNavigation = (props: GrowiContextualSubNavigationProps): JSX.Element => {
   const { isLinkSharingDisabled } = props;
   const { data: currentPage } = useSWRxCurrentPage();
-  if (currentPage == null) { return <></> }
   return (
     <div data-testid="grw-contextual-sub-nav">
       <GrowiContextualSubNavigationSubstance currentPage={currentPage} isLinkSharingDisabled={isLinkSharingDisabled}/>