Yuki Takei 3 лет назад
Родитель
Сommit
98327dc552
2 измененных файлов с 15 добавлено и 8 удалено
  1. 11 4
      packages/app/src/components/NotFoundPage.tsx
  2. 4 4
      packages/app/src/components/Page/PageView.tsx

+ 11 - 4
packages/app/src/components/NotFoundPage.tsx

@@ -3,19 +3,26 @@ import React, { useMemo } from 'react';
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
 
 
 import CustomNavAndContents from './CustomNavigation/CustomNavAndContents';
 import CustomNavAndContents from './CustomNavigation/CustomNavAndContents';
-import { DescendantsPageListForCurrentPath } from './DescendantsPageList';
+import { DescendantsPageList } from './DescendantsPageList';
 import PageListIcon from './Icons/PageListIcon';
 import PageListIcon from './Icons/PageListIcon';
 import TimeLineIcon from './Icons/TimeLineIcon';
 import TimeLineIcon from './Icons/TimeLineIcon';
 import { PageTimeline } from './PageTimeline';
 import { PageTimeline } from './PageTimeline';
 
 
-const NotFoundPage = (): JSX.Element => {
+
+type NotFoundPageProps = {
+  path: string,
+}
+
+const NotFoundPage = (props: NotFoundPageProps): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
+  const { path } = props;
+
   const navTabMapping = useMemo(() => {
   const navTabMapping = useMemo(() => {
     return {
     return {
       pagelist: {
       pagelist: {
         Icon: PageListIcon,
         Icon: PageListIcon,
-        Content: DescendantsPageListForCurrentPath,
+        Content: () => <DescendantsPageList path={path} />,
         i18n: t('page_list'),
         i18n: t('page_list'),
         index: 0,
         index: 0,
       },
       },
@@ -26,7 +33,7 @@ const NotFoundPage = (): JSX.Element => {
         index: 1,
         index: 1,
       },
       },
     };
     };
-  }, [t]);
+  }, [path, t]);
 
 
   return (
   return (
     <div className="d-edit-none">
     <div className="d-edit-none">

+ 4 - 4
packages/app/src/components/Page/PageView.tsx

@@ -69,15 +69,15 @@ export const PageView = (props: Props): JSX.Element => {
       return <NotCreatablePage />;
       return <NotCreatablePage />;
     }
     }
     if (isNotFound) {
     if (isNotFound) {
-      return <NotFoundPage />;
+      return <NotFoundPage path={pagePath} />;
     }
     }
-  }, [isForbidden, isIdenticalPathPage, isNotCreatable, isNotFound]);
+  }, [isForbidden, isIdenticalPathPage, isNotCreatable, isNotFound, pagePath]);
 
 
   const sideContents = !isNotFound && !isNotCreatable
   const sideContents = !isNotFound && !isNotCreatable
     ? (
     ? (
       <PageSideContents page={page} />
       <PageSideContents page={page} />
     )
     )
-    : <></>;
+    : null;
 
 
   const footerContents = !isIdenticalPathPage && !isNotFound && page != null
   const footerContents = !isIdenticalPathPage && !isNotFound && page != null
     ? (
     ? (
@@ -91,7 +91,7 @@ export const PageView = (props: Props): JSX.Element => {
         <PageContentFooter page={page} />
         <PageContentFooter page={page} />
       </>
       </>
     )
     )
-    : <></>;
+    : null;
 
 
   const isUsersHomePagePath = isUsersHomePage(pagePath);
   const isUsersHomePagePath = isUsersHomePage(pagePath);