Просмотр исходного кода

delete appcontainer PageComment.tsx

ryoji-s 3 лет назад
Родитель
Сommit
8fc899731e
2 измененных файлов с 5 добавлено и 7 удалено
  1. 3 4
      packages/app/src/components/PageComment.tsx
  2. 2 3
      packages/app/src/pages/[[...path]].page.tsx

+ 3 - 4
packages/app/src/components/PageComment.tsx

@@ -4,8 +4,8 @@ import React, {
 
 
 import { Button } from 'reactstrap';
 import { Button } from 'reactstrap';
 
 
+import { Nullable } from '~/interfaces/common';
 
 
-import AppContainer from '~/client/services/AppContainer';
 import { toastError } from '~/client/util/apiNotification';
 import { toastError } from '~/client/util/apiNotification';
 import { apiPost } from '~/client/util/apiv1-client';
 import { apiPost } from '~/client/util/apiv1-client';
 import { useCommentPreviewRenderer } from '~/stores/renderer';
 import { useCommentPreviewRenderer } from '~/stores/renderer';
@@ -20,8 +20,7 @@ import DeleteCommentModal from './PageComment/DeleteCommentModal';
 import ReplayComments from './PageComment/ReplayComments';
 import ReplayComments from './PageComment/ReplayComments';
 
 
 type Props = {
 type Props = {
-  appContainer: AppContainer,
-  pageId: string,
+  pageId?: Nullable<string>,
   isReadOnly : boolean,
   isReadOnly : boolean,
   titleAlign?: 'center' | 'left' | 'right',
   titleAlign?: 'center' | 'left' | 'right',
   highlightKeywords?:string[],
   highlightKeywords?:string[],
@@ -32,7 +31,7 @@ type Props = {
 const PageComment:FC<Props> = memo((props:Props):JSX.Element => {
 const PageComment:FC<Props> = memo((props:Props):JSX.Element => {
 
 
   const {
   const {
-    appContainer, pageId, highlightKeywords, isReadOnly, titleAlign, hideIfEmpty,
+    pageId, highlightKeywords, isReadOnly, titleAlign, hideIfEmpty,
   } = props;
   } = props;
 
 
   const { data: comments, mutate } = useSWRxPageComment(pageId);
   const { data: comments, mutate } = useSWRxPageComment(pageId);

+ 2 - 3
packages/app/src/pages/[[...path]].page.tsx

@@ -13,7 +13,7 @@ import Head from 'next/head';
 import { useRouter } from 'next/router';
 import { useRouter } from 'next/router';
 
 
 import { PageAlerts } from '~/components/PageAlert/PageAlerts';
 import { PageAlerts } from '~/components/PageAlert/PageAlerts';
-// import { PageComments } from '~/components/PageComment/PageComments';
+import PageComment from '~/components/PageComment';
 // import { useTranslation } from '~/i18n';
 // import { useTranslation } from '~/i18n';
 import { CrowiRequest } from '~/interfaces/crowi-request';
 import { CrowiRequest } from '~/interfaces/crowi-request';
 // import { renderScriptTagByName, renderHighlightJsStyleTag } from '~/service/cdn-resources-loader';
 // import { renderScriptTagByName, renderHighlightJsStyleTag } from '~/service/cdn-resources-loader';
@@ -287,8 +287,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
 
 
         </div>
         </div>
         <footer>
         <footer>
-          {/* <PageComments /> */}
-          PageComments
+          <PageComment pageId={useCurrentPageId()} isReadOnly={false} titleAlign="left" />
         </footer>
         </footer>
 
 
         <UnsavedAlertDialog />
         <UnsavedAlertDialog />