|
@@ -19,7 +19,6 @@ import superjson from 'superjson';
|
|
|
|
|
|
|
|
import { Comments } from '~/components/Comments';
|
|
import { Comments } from '~/components/Comments';
|
|
|
import { PageAlerts } from '~/components/PageAlert/PageAlerts';
|
|
import { PageAlerts } from '~/components/PageAlert/PageAlerts';
|
|
|
-import { MaintenanceMode } from '~/components/MaintenanceMode';
|
|
|
|
|
// import { useTranslation } from '~/i18n';
|
|
// import { useTranslation } from '~/i18n';
|
|
|
import { PageContentFooter } from '~/components/PageContentFooter';
|
|
import { PageContentFooter } from '~/components/PageContentFooter';
|
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
@@ -71,6 +70,7 @@ import {
|
|
|
} from './utils/commons';
|
|
} from './utils/commons';
|
|
|
// import { useCurrentPageSWR } from '../stores/page';
|
|
// import { useCurrentPageSWR } from '../stores/page';
|
|
|
|
|
|
|
|
|
|
+import styles from './[[...path]].page.module.scss';
|
|
|
|
|
|
|
|
const NotCreatablePage = dynamic(() => import('../components/NotCreatablePage').then(mod => mod.NotCreatablePage), { ssr: false });
|
|
const NotCreatablePage = dynamic(() => import('../components/NotCreatablePage').then(mod => mod.NotCreatablePage), { ssr: false });
|
|
|
const ForbiddenPage = dynamic(() => import('../components/ForbiddenPage'), { ssr: false });
|
|
const ForbiddenPage = dynamic(() => import('../components/ForbiddenPage'), { ssr: false });
|
|
@@ -162,8 +162,6 @@ type Props = CommonProps & {
|
|
|
// isIndentSizeForced: boolean,
|
|
// isIndentSizeForced: boolean,
|
|
|
disableLinkSharing: boolean,
|
|
disableLinkSharing: boolean,
|
|
|
|
|
|
|
|
- isMaintenanceMode: boolean,
|
|
|
|
|
-
|
|
|
|
|
rendererConfig: RendererConfig,
|
|
rendererConfig: RendererConfig,
|
|
|
|
|
|
|
|
// UI
|
|
// UI
|
|
@@ -177,7 +175,6 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
const { data: currentUser } = useCurrentUser(props.currentUser ?? null);
|
|
const { data: currentUser } = useCurrentUser(props.currentUser ?? null);
|
|
|
- const title = useCustomTitle(props, 'GROWI');
|
|
|
|
|
|
|
|
|
|
// register global EventEmitter
|
|
// register global EventEmitter
|
|
|
if (isClient()) {
|
|
if (isClient()) {
|
|
@@ -282,10 +279,6 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
// classNames.push('not-found-page');
|
|
// classNames.push('not-found-page');
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- if (props.isMaintenanceMode) {
|
|
|
|
|
- return <MaintenanceMode />;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<Head>
|
|
<Head>
|
|
@@ -297,90 +290,93 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
*/}
|
|
*/}
|
|
|
</Head>
|
|
</Head>
|
|
|
{/* <BasicLayout title={useCustomTitle(props, t('GROWI'))} className={classNames.join(' ')}> */}
|
|
{/* <BasicLayout title={useCustomTitle(props, t('GROWI'))} className={classNames.join(' ')}> */}
|
|
|
- <BasicLayout title={title} className={classNames.join(' ')} expandContainer={props.isContainerFluid}>
|
|
|
|
|
- <header className="py-0 position-relative">
|
|
|
|
|
- <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />
|
|
|
|
|
- </header>
|
|
|
|
|
- <div className="d-edit-none">
|
|
|
|
|
- <GrowiSubNavigationSwitcher />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <BasicLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')} expandContainer={props.isContainerFluid}>
|
|
|
|
|
+ <div className="h-100 d-flex flex-column justify-content-between">
|
|
|
|
|
+ <header className="py-0 position-relative">
|
|
|
|
|
+ <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />
|
|
|
|
|
+ </header>
|
|
|
|
|
+ <div className="d-edit-none">
|
|
|
|
|
+ <GrowiSubNavigationSwitcher />
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div id="grw-subnav-sticky-trigger" className="sticky-top"></div>
|
|
|
|
|
- <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
|
|
|
|
|
-
|
|
|
|
|
- <div id="main" className={`main ${isUsersHomePage(props.currentPathname) && 'user-page'}`}>
|
|
|
|
|
- <div id="content-main" className="content-main grw-container-convertible">
|
|
|
|
|
- <div className="row">
|
|
|
|
|
- <div className="col">
|
|
|
|
|
- { props.isIdenticalPathPage && <IdenticalPathPage /> }
|
|
|
|
|
-
|
|
|
|
|
- { !props.isIdenticalPathPage && (
|
|
|
|
|
- <>
|
|
|
|
|
- <PageAlerts />
|
|
|
|
|
- { props.isForbidden && <ForbiddenPage /> }
|
|
|
|
|
- { props.IsNotCreatable && <NotCreatablePage />}
|
|
|
|
|
- { !props.isForbidden && !props.IsNotCreatable && <DisplaySwitcher />}
|
|
|
|
|
- {/* <DisplaySwitcher /> */}
|
|
|
|
|
- <div id="page-editor-navbar-bottom-container" className="d-none d-edit-block"></div>
|
|
|
|
|
- {/* <PageStatusAlert /> */}
|
|
|
|
|
- </>
|
|
|
|
|
- ) }
|
|
|
|
|
|
|
+ <div id="grw-subnav-sticky-trigger" className="sticky-top"></div>
|
|
|
|
|
+ <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
|
|
|
|
|
+
|
|
|
|
|
+ <div className="flex-grow-1">
|
|
|
|
|
+ <div id="main" className={`main ${isUsersHomePage(props.currentPathname) && 'user-page'}`}>
|
|
|
|
|
+ <div id="content-main" className="content-main grw-container-convertible">
|
|
|
|
|
+ <div className="row">
|
|
|
|
|
+ <div className="col">
|
|
|
|
|
+ { props.isIdenticalPathPage && <IdenticalPathPage /> }
|
|
|
|
|
+
|
|
|
|
|
+ { !props.isIdenticalPathPage && (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <PageAlerts />
|
|
|
|
|
+ { props.isForbidden && <ForbiddenPage /> }
|
|
|
|
|
+ { props.IsNotCreatable && <NotCreatablePage />}
|
|
|
|
|
+ { !props.isForbidden && !props.IsNotCreatable && <DisplaySwitcher />}
|
|
|
|
|
+ {/* <DisplaySwitcher /> */}
|
|
|
|
|
+ <div id="page-editor-navbar-bottom-container" className="d-none d-edit-block"></div>
|
|
|
|
|
+ {/* <PageStatusAlert /> */}
|
|
|
|
|
+ </>
|
|
|
|
|
+ ) }
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- {/* <div className="col-xl-2 col-lg-3 d-none d-lg-block revision-toc-container">
|
|
|
|
|
- <div id="revision-toc" className="revision-toc mt-3 sps sps--abv" data-sps-offset="123">
|
|
|
|
|
- <div id="revision-toc-content" className="revision-toc-content"></div>
|
|
|
|
|
|
|
+ {/* <div className="col-xl-2 col-lg-3 d-none d-lg-block revision-toc-container">
|
|
|
|
|
+ <div id="revision-toc" className="revision-toc mt-3 sps sps--abv" data-sps-offset="123">
|
|
|
|
|
+ <div id="revision-toc-content" className="revision-toc-content"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div> */}
|
|
|
</div>
|
|
</div>
|
|
|
- </div> */}
|
|
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- {/* TODO: Check CSS import */}
|
|
|
|
|
- <footer className="footer d-edit-none">
|
|
|
|
|
- {/* TODO: Enable page_list.html */}
|
|
|
|
|
- {/* TODO: Enable isIdenticalPathPage or useIdenticalPath */}
|
|
|
|
|
- {/* { !props.isIdenticalPathPage && ( */}
|
|
|
|
|
- <Comments pageId={pageId} />
|
|
|
|
|
- {/* )} */}
|
|
|
|
|
- {/* TODO: Create UsersHomePageFooter conponent */}
|
|
|
|
|
- { isUsersHomePage(props.currentPathname) && (
|
|
|
|
|
- <div className="container-lg user-page-footer py-5">
|
|
|
|
|
- <div className="grw-user-page-list-m d-edit-none">
|
|
|
|
|
- <h2 id="bookmarks-list" className="grw-user-page-header border-bottom pb-2 mb-3">
|
|
|
|
|
- <i style={{ fontSize: '1.3em' }} className="fa fa-fw fa-bookmark-o"></i>
|
|
|
|
|
- Bookmarks
|
|
|
|
|
- </h2>
|
|
|
|
|
- <div id="user-bookmark-list" className="page-list">
|
|
|
|
|
- {/* TODO: No need page-list-container class ? */}
|
|
|
|
|
- <div className="page-list-container">
|
|
|
|
|
- {/* <BookmarkList userId={pageContainer.state.creator._id} /> */}
|
|
|
|
|
|
|
+ {/* TODO: Check CSS import */}
|
|
|
|
|
+ <footer className="footer d-edit-none">
|
|
|
|
|
+ {/* TODO: Enable page_list.html */}
|
|
|
|
|
+ {/* TODO: Enable isIdenticalPathPage or useIdenticalPath */}
|
|
|
|
|
+ {/* { !props.isIdenticalPathPage && ( */}
|
|
|
|
|
+ <Comments pageId={pageId} />
|
|
|
|
|
+ {/* )} */}
|
|
|
|
|
+ {/* TODO: Create UsersHomePageFooter conponent */}
|
|
|
|
|
+ { isUsersHomePage(props.currentPathname) && (
|
|
|
|
|
+ <div className="container-lg user-page-footer py-5">
|
|
|
|
|
+ <div className="grw-user-page-list-m d-edit-none">
|
|
|
|
|
+ <h2 id="bookmarks-list" className="grw-user-page-header border-bottom pb-2 mb-3">
|
|
|
|
|
+ <i style={{ fontSize: '1.3em' }} className="fa fa-fw fa-bookmark-o"></i>
|
|
|
|
|
+ Bookmarks
|
|
|
|
|
+ </h2>
|
|
|
|
|
+ <div id="user-bookmark-list" className={`page-list ${styles['page-list']}`}>
|
|
|
|
|
+ {/* TODO: No need page-list-container class ? */}
|
|
|
|
|
+ <div className="page-list-container">
|
|
|
|
|
+ {/* <BookmarkList userId={pageContainer.state.creator._id} /> */}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div className="grw-user-page-list-m mt-5 d-edit-none">
|
|
|
|
|
- <h2 id="recently-created-list" className="grw-user-page-header border-bottom pb-2 mb-3">
|
|
|
|
|
- <i id="recent-created-icon" className="mr-1">
|
|
|
|
|
- {/* <RecentlyCreatedIcon /> */}
|
|
|
|
|
- </i>
|
|
|
|
|
- Recently Created
|
|
|
|
|
- </h2>
|
|
|
|
|
- <div id="user-created-list" className="page-list">
|
|
|
|
|
- {/* TODO: No need page-list-container class ? */}
|
|
|
|
|
- <div className="page-list-container">
|
|
|
|
|
- {/* <RecentCreated userId={pageContainer.state.creator._id} /> */}
|
|
|
|
|
|
|
+ <div className="grw-user-page-list-m mt-5 d-edit-none">
|
|
|
|
|
+ <h2 id="recently-created-list" className="grw-user-page-header border-bottom pb-2 mb-3">
|
|
|
|
|
+ <i id="recent-created-icon" className="mr-1">
|
|
|
|
|
+ {/* <RecentlyCreatedIcon /> */}
|
|
|
|
|
+ </i>
|
|
|
|
|
+ Recently Created
|
|
|
|
|
+ </h2>
|
|
|
|
|
+ <div id="user-created-list" className={`page-list ${styles['page-list']}`}>
|
|
|
|
|
+ {/* TODO: No need page-list-container class ? */}
|
|
|
|
|
+ <div className="page-list-container">
|
|
|
|
|
+ {/* <RecentCreated userId={pageContainer.state.creator._id} /> */}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
- <PageContentFooter />
|
|
|
|
|
- </footer>
|
|
|
|
|
-
|
|
|
|
|
- <UnsavedAlertDialog />
|
|
|
|
|
- <DescendantsPageListModal />
|
|
|
|
|
- {shouldRenderPutbackPageModal && <PutbackPageModal />}
|
|
|
|
|
|
|
+ )}
|
|
|
|
|
+ <PageContentFooter />
|
|
|
|
|
+ </footer>
|
|
|
|
|
|
|
|
|
|
+ <UnsavedAlertDialog />
|
|
|
|
|
+ <DescendantsPageListModal />
|
|
|
|
|
+ {shouldRenderPutbackPageModal && <PutbackPageModal />}
|
|
|
|
|
+ </div>
|
|
|
</BasicLayout>
|
|
</BasicLayout>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
@@ -548,8 +544,6 @@ function injectServerConfigurations(context: GetServerSidePropsContext, props: P
|
|
|
// props.adminPreferredIndentSize = configManager.getConfig('markdown', 'markdown:adminPreferredIndentSize');
|
|
// props.adminPreferredIndentSize = configManager.getConfig('markdown', 'markdown:adminPreferredIndentSize');
|
|
|
// props.isIndentSizeForced = configManager.getConfig('markdown', 'markdown:isIndentSizeForced');
|
|
// props.isIndentSizeForced = configManager.getConfig('markdown', 'markdown:isIndentSizeForced');
|
|
|
|
|
|
|
|
- props.isMaintenanceMode = crowi.appService.isMaintenanceMode();
|
|
|
|
|
-
|
|
|
|
|
props.rendererConfig = {
|
|
props.rendererConfig = {
|
|
|
isEnabledLinebreaks: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaks'),
|
|
isEnabledLinebreaks: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaks'),
|
|
|
isEnabledLinebreaksInComments: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaksInComments'),
|
|
isEnabledLinebreaksInComments: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaksInComments'),
|