jam411 3 лет назад
Родитель
Сommit
40579d6630

+ 0 - 1
packages/app/src/components/Navbar/GlobalSearch.tsx

@@ -15,7 +15,6 @@ import SearchForm from '../SearchForm';
 
 
 import styles from './GlobalSearch.module.scss';
 import styles from './GlobalSearch.module.scss';
 
 
-
 export type GlobalSearchProps = {
 export type GlobalSearchProps = {
   dropup?: boolean,
   dropup?: boolean,
 }
 }

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

@@ -2,11 +2,12 @@ import React, {
   FC, useEffect, useState, useMemo, memo, useCallback,
   FC, useEffect, useState, useMemo, memo, useCallback,
 } from 'react';
 } from 'react';
 
 
+import { Nullable } from '@growi/core';
 import { Button } from 'reactstrap';
 import { Button } from 'reactstrap';
 
 
 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 { useCurrentPageId, useCurrentPagePath } from '~/stores/context';
+import { useCurrentPagePath } from '~/stores/context';
 import { useSWRxCurrentPage } from '~/stores/page';
 import { useSWRxCurrentPage } from '~/stores/page';
 import { useCommentPreviewOptions } from '~/stores/renderer';
 import { useCommentPreviewOptions } from '~/stores/renderer';
 
 
@@ -22,6 +23,7 @@ import { ReplayComments } from './PageComment/ReplayComments';
 import styles from './PageComment.module.scss';
 import styles from './PageComment.module.scss';
 
 
 type Props = {
 type Props = {
+  pageId?: Nullable<string>
   isReadOnly: boolean,
   isReadOnly: boolean,
   titleAlign?: 'center' | 'left' | 'right',
   titleAlign?: 'center' | 'left' | 'right',
   highlightKeywords?: string[],
   highlightKeywords?: string[],
@@ -31,10 +33,9 @@ type Props = {
 export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
 export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
 
 
   const {
   const {
-    highlightKeywords, isReadOnly, titleAlign, hideIfEmpty,
+    pageId, highlightKeywords, isReadOnly, titleAlign, hideIfEmpty,
   } = props;
   } = props;
 
 
-  const { data: pageId } = useCurrentPageId();
   const { data: comments, mutate } = useSWRxPageComment(pageId);
   const { data: comments, mutate } = useSWRxPageComment(pageId);
   const { data: rendererOptions } = useCommentPreviewOptions();
   const { data: rendererOptions } = useCommentPreviewOptions();
   const { data: currentPage } = useSWRxCurrentPage();
   const { data: currentPage } = useSWRxCurrentPage();

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

@@ -326,7 +326,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
         </div>
         </div>
         <footer>
         <footer>
           {/* <PageComments /> */}
           {/* <PageComments /> */}
-          <PageComment isReadOnly={false} titleAlign="left" />
+          <PageComment pageId={useCurrentPageId().data} isReadOnly={false} titleAlign="left" />
           <PageContentFooter />
           <PageContentFooter />
         </footer>
         </footer>