jam411 před 3 roky
rodič
revize
f1936234da

+ 10 - 24
packages/app/src/components/PageComment.tsx

@@ -20,8 +20,6 @@ import { CommentEditorLazyRenderer } from './PageComment/CommentEditorLazyRender
 import { DeleteCommentModal } from './PageComment/DeleteCommentModal';
 import { DeleteCommentModal } from './PageComment/DeleteCommentModal';
 import { ReplyComments } from './PageComment/ReplyComments';
 import { ReplyComments } from './PageComment/ReplyComments';
 
 
-import styles from './PageComment.module.scss';
-
 type Props = {
 type Props = {
   pageId?: Nullable<string>
   pageId?: Nullable<string>
   isReadOnly: boolean,
   isReadOnly: boolean,
@@ -119,26 +117,13 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
     });
     });
   }, []);
   }, []);
 
 
-  let commentTitleClasses = 'border-bottom py-3 mb-3';
-  commentTitleClasses = titleAlign != null ? `${commentTitleClasses} text-${titleAlign}` : `${commentTitleClasses} text-center`;
+  if (commentsFromOldest == null || commentsExceptReply == null) return <></>;
 
 
-  if (commentsFromOldest == null || commentsExceptReply == null || rendererOptions == null || currentPagePath == null || currentPage == null
-    || (hideIfEmpty && comments?.length === 0)) {
-    return (
-      <>
-        <div className="page-comments-row comment-list mt-5 py-4 d-edit-none d-print-none">
-          {/* TODO: container-lg expected global import, _override.scss */}
-          <div className="container-lg">
-            <div className="page-comments">
-              <h2 className={commentTitleClasses}><i className="icon-fw icon-bubbles"></i>Comments</h2>
-              <div className="text-muted text-center mt-3">
-                <i className="fa fa-lg fa-spinner fa-pulse mr-1"></i>
-              </div>
-            </div>
-          </div>
-        </div>
-      </>
-    );
+  if (hideIfEmpty && comments?.length === 0) {
+    return <></>;
+  }
+  if (rendererOptions == null || currentPagePath == null || currentPage == null) {
+    return <></>;
   }
   }
 
 
   const generateCommentInnerElement = (comment: ICommentHasId) => (
   const generateCommentInnerElement = (comment: ICommentHasId) => (
@@ -167,10 +152,12 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
     />
     />
   );
   );
 
 
+  let commentTitleClasses = 'border-bottom py-3 mb-3';
+  commentTitleClasses = titleAlign != null ? `${commentTitleClasses} text-${titleAlign}` : `${commentTitleClasses} text-center`;
+
   return (
   return (
     <>
     <>
-      <div className={`${styles['page-comment-module']} page-comments-row comment-list mt-5 py-4 d-edit-none d-print-none`}>
-        {/* TODO: container-lg expected global import, _override.scss */}
+      <div className="page-comments-row comment-list">
         <div className="container-lg">
         <div className="container-lg">
           <div className="page-comments">
           <div className="page-comments">
             <h2 className={commentTitleClasses}><i className="icon-fw icon-bubbles"></i>Comments</h2>
             <h2 className={commentTitleClasses}><i className="icon-fw icon-bubbles"></i>Comments</h2>
@@ -223,7 +210,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
                 );
                 );
 
 
               })}
               })}
-
             </div>
             </div>
             {/* TODO: Check if identical-page */}
             {/* TODO: Check if identical-page */}
             <CommentEditorLazyRenderer pageId={pageId} rendererOptions={rendererOptions}/>
             <CommentEditorLazyRenderer pageId={pageId} rendererOptions={rendererOptions}/>

+ 1 - 2
packages/app/src/components/PageContentFooter.tsx

@@ -16,9 +16,8 @@ export const PageContentFooter = memo((): JSX.Element => {
 
 
   const { data: page } = useSWRxCurrentPage();
   const { data: page } = useSWRxCurrentPage();
 
 
-  // TODO: update Skelton props
   if (page == null) {
   if (page == null) {
-    return <Skelton width={300} height={20} additionalClass={'mb-3'} />;
+    return <></>;
   }
   }
 
 
   return (
   return (

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

@@ -6,7 +6,6 @@ import EventEmitter from 'events';
 import {
 import {
   IDataWithMeta, IPageInfoForEntity, IPagePopulatedToShowRevision, isClient, isIPageInfoForEntity, isServer, IUser, IUserHasId, pagePathUtils, pathUtils,
   IDataWithMeta, IPageInfoForEntity, IPagePopulatedToShowRevision, isClient, isIPageInfoForEntity, isServer, IUser, IUserHasId, pagePathUtils, pathUtils,
 } from '@growi/core';
 } from '@growi/core';
-import { EditorConfiguration } from 'codemirror';
 import ExtensibleCustomError from 'extensible-custom-error';
 import ExtensibleCustomError from 'extensible-custom-error';
 import mongoose from 'mongoose';
 import mongoose from 'mongoose';
 import {
 import {