Yuki Takei 3 лет назад
Родитель
Сommit
968417dbac

+ 5 - 2
packages/app/src/components/Page/DisplaySwitcher.tsx

@@ -24,8 +24,6 @@ const { isUsersHomePage } = pagePathUtils;
 const NotCreatablePage = dynamic(() => import('../NotCreatablePage').then(mod => mod.NotCreatablePage), { ssr: false });
 const NotCreatablePage = dynamic(() => import('../NotCreatablePage').then(mod => mod.NotCreatablePage), { ssr: false });
 const ForbiddenPage = dynamic(() => import('../ForbiddenPage'), { ssr: false });
 const ForbiddenPage = dynamic(() => import('../ForbiddenPage'), { ssr: false });
 const NotFoundPage = dynamic(() => import('../NotFoundPage'), { ssr: false });
 const NotFoundPage = dynamic(() => import('../NotFoundPage'), { ssr: false });
-
-const Page = dynamic(() => import('../Page').then(mod => mod.Page), { ssr: false });
 const PageSideContents = dynamic<PageSideContentsProps>(() => import('../PageSideContents').then(mod => mod.PageSideContents), { ssr: false });
 const PageSideContents = dynamic<PageSideContentsProps>(() => import('../PageSideContents').then(mod => mod.PageSideContents), { ssr: false });
 const Comments = dynamic(() => import('../Comments').then(mod => mod.Comments), { ssr: false });
 const Comments = dynamic(() => import('../Comments').then(mod => mod.Comments), { ssr: false });
 const UsersHomePageFooter = dynamic<UsersHomePageFooterProps>(() => import('../UsersHomePageFooter')
 const UsersHomePageFooter = dynamic<UsersHomePageFooterProps>(() => import('../UsersHomePageFooter')
@@ -59,6 +57,11 @@ const View = (props: Props): JSX.Element => {
 
 
   const pageId = page?._id;
   const pageId = page?._id;
 
 
+  const Page = dynamic(() => import('./Page').then(mod => mod.Page), {
+    ssr: false,
+    loading: () => <span>loading...</span>,
+  });
+
   const specialContents = useMemo(() => {
   const specialContents = useMemo(() => {
     if (isIdenticalPathPage) {
     if (isIdenticalPathPage) {
       return <IdenticalPathPage />;
       return <IdenticalPathPage />;

+ 0 - 0
packages/app/src/components/Page.module.scss → packages/app/src/components/Page/Page.module.scss


+ 2 - 2
packages/app/src/components/Page.tsx → packages/app/src/components/Page/Page.tsx

@@ -2,7 +2,7 @@ import React, {
   useCallback, useEffect, useRef,
   useCallback, useEffect, useRef,
 } from 'react';
 } from 'react';
 
 
-import { pagePathUtils } from '@growi/core';
+import { IPagePopulatedToShowRevision, pagePathUtils } from '@growi/core';
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
 import { HtmlElementNode } from 'rehype-toc';
 import { HtmlElementNode } from 'rehype-toc';
 
 
@@ -22,7 +22,7 @@ import {
 import { registerGrowiFacade } from '~/utils/growi-facade';
 import { registerGrowiFacade } from '~/utils/growi-facade';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
-import RevisionRenderer from './Page/RevisionRenderer';
+import RevisionRenderer from './RevisionRenderer';
 
 
 import styles from './Page.module.scss';
 import styles from './Page.module.scss';
 
 

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

@@ -13,7 +13,7 @@ import { useCurrentGrowiLayoutFluidClassName } from '~/client/services/layout';
 import { MainPane } from '~/components/Layout/MainPane';
 import { MainPane } from '~/components/Layout/MainPane';
 import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
 import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
 import GrowiContextualSubNavigationSubstance from '~/components/Navbar/GrowiContextualSubNavigation';
 import GrowiContextualSubNavigationSubstance from '~/components/Navbar/GrowiContextualSubNavigation';
-import { Page } from '~/components/Page';
+import { Page } from '~/components/Page/Page';
 import type { PageSideContentsProps } from '~/components/PageSideContents';
 import type { PageSideContentsProps } from '~/components/PageSideContents';
 import { DrawioViewerScript } from '~/components/Script/DrawioViewerScript';
 import { DrawioViewerScript } from '~/components/Script/DrawioViewerScript';
 import { SupportedAction, SupportedActionType } from '~/interfaces/activity';
 import { SupportedAction, SupportedActionType } from '~/interfaces/activity';