Sfoglia il codice sorgente

Create TrashPageViewLayout

satof3 2 anni fa
parent
commit
137619acba

+ 30 - 0
apps/app/src/components/TrashPageViewLayout.tsx

@@ -0,0 +1,30 @@
+import type { IPagePopulatedToShowRevision } from '@growi/core';
+
+
+import { PagePathNavSticky } from './Common/PagePathNav';
+
+import styles from './common/PageViewLayout.module.scss';
+
+type Props = {
+  pagePath: string,
+  page?: IPagePopulatedToShowRevision,
+  expandContentWidth?: boolean,
+}
+
+export const TrashPageViewLayout = (props: Props): JSX.Element => {
+  const {
+    pagePath, expandContentWidth,
+  } = props;
+
+  const pageViewLayoutClass = styles['page-view-layout'] ?? '';
+  const _fluidLayoutClass = styles['fluid-layout'] ?? '';
+  const fluidLayoutClass = expandContentWidth ? _fluidLayoutClass : '';
+
+  return (
+    <div id="main" className={`main ${pageViewLayoutClass} ${fluidLayoutClass} flex-expand-vert`}>
+      <div id="content-main" className="content-main container-lg grw-container-convertible flex-expand-vert">
+        <PagePathNavSticky pagePath={pagePath} />
+      </div>
+    </div>
+  );
+};

+ 4 - 2
apps/app/src/pages/trash.page.tsx

@@ -7,13 +7,13 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
 import Head from 'next/head';
 
-import { PagePathNavSticky } from '~/components/Common/PagePathNav';
 import type { CrowiRequest } from '~/interfaces/crowi-request';
 import type { RendererConfig } from '~/interfaces/services/renderer';
 import { useCurrentPageId, useSWRxCurrentPage } from '~/stores/page';
 
 import { BasicLayout } from '../components/Layout/BasicLayout';
 import GrowiContextualSubNavigationSubstance from '../components/Navbar/GrowiContextualSubNavigation';
+import { TrashPageViewLayout } from '../components/TrashPageViewLayout';
 import {
   useCurrentUser, useCurrentPathname, useGrowiCloudUri,
   useIsSearchServiceConfigured, useIsSearchServiceReachable,
@@ -75,7 +75,9 @@ const TrashPage: NextPageWithLayout<CommonProps> = (props: Props) => {
         </nav>
 
         <div className="content-main container-lg mb-5 pb-5">
-          <PagePathNavSticky pagePath="/trash" />
+          <TrashPageViewLayout
+            pagePath="/trash"
+          />
           <TrashPageList />
         </div>