|
@@ -7,6 +7,7 @@ import dynamic from 'next/dynamic';
|
|
|
import { useHackmdDraftUpdatedEffect } from '~/client/services/side-effects/hackmd-draft-updated';
|
|
import { useHackmdDraftUpdatedEffect } from '~/client/services/side-effects/hackmd-draft-updated';
|
|
|
import { useHashChangedEffect } from '~/client/services/side-effects/hash-changed';
|
|
import { useHashChangedEffect } from '~/client/services/side-effects/hash-changed';
|
|
|
import { usePageUpdatedEffect } from '~/client/services/side-effects/page-updated';
|
|
import { usePageUpdatedEffect } from '~/client/services/side-effects/page-updated';
|
|
|
|
|
+import type { RendererConfig } from '~/interfaces/services/renderer';
|
|
|
import { useIsEditable } from '~/stores/context';
|
|
import { useIsEditable } from '~/stores/context';
|
|
|
import { EditorMode, useEditorMode } from '~/stores/ui';
|
|
import { EditorMode, useEditorMode } from '~/stores/ui';
|
|
|
|
|
|
|
@@ -18,6 +19,8 @@ import type { PageSideContentsProps } from '../PageSideContents';
|
|
|
import { UserInfo } from '../User/UserInfo';
|
|
import { UserInfo } from '../User/UserInfo';
|
|
|
import type { UsersHomePageFooterProps } from '../UsersHomePageFooter';
|
|
import type { UsersHomePageFooterProps } from '../UsersHomePageFooter';
|
|
|
|
|
|
|
|
|
|
+import { Page2 } from './Page2';
|
|
|
|
|
+
|
|
|
const { isUsersHomePage } = pagePathUtils;
|
|
const { isUsersHomePage } = pagePathUtils;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -41,6 +44,7 @@ const IdenticalPathPage = (): JSX.Element => {
|
|
|
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
|
|
|
+ rendererConfig: RendererConfig,
|
|
|
pagePath: string,
|
|
pagePath: string,
|
|
|
page?: IPagePopulatedToShowRevision,
|
|
page?: IPagePopulatedToShowRevision,
|
|
|
isIdenticalPathPage?: boolean,
|
|
isIdenticalPathPage?: boolean,
|
|
@@ -51,17 +55,13 @@ type Props = {
|
|
|
|
|
|
|
|
const View = (props: Props): JSX.Element => {
|
|
const View = (props: Props): JSX.Element => {
|
|
|
const {
|
|
const {
|
|
|
|
|
+ rendererConfig,
|
|
|
pagePath, page,
|
|
pagePath, page,
|
|
|
isIdenticalPathPage, isNotFound, isForbidden, isNotCreatable,
|
|
isIdenticalPathPage, isNotFound, isForbidden, isNotCreatable,
|
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
|
|
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 />;
|
|
@@ -110,7 +110,7 @@ const View = (props: Props): JSX.Element => {
|
|
|
{ specialContents == null && (
|
|
{ specialContents == null && (
|
|
|
<>
|
|
<>
|
|
|
{ isUsersHomePagePath && <UserInfo author={page?.creator} /> }
|
|
{ isUsersHomePagePath && <UserInfo author={page?.creator} /> }
|
|
|
- <Page />
|
|
|
|
|
|
|
+ <Page2 rendererConfig={rendererConfig} pagePath={pagePath} markdownForSSR={page?.revision.body} />
|
|
|
</>
|
|
</>
|
|
|
) }
|
|
) }
|
|
|
|
|
|