|
@@ -19,6 +19,7 @@ import { CommentEditor } from './PageComment/CommentEditor';
|
|
|
import { CommentEditorLazyRenderer } from './PageComment/CommentEditorLazyRenderer';
|
|
import { CommentEditorLazyRenderer } from './PageComment/CommentEditorLazyRenderer';
|
|
|
import DeleteCommentModal from './PageComment/DeleteCommentModal';
|
|
import DeleteCommentModal from './PageComment/DeleteCommentModal';
|
|
|
import { ReplayComments } from './PageComment/ReplayComments';
|
|
import { ReplayComments } from './PageComment/ReplayComments';
|
|
|
|
|
+import { Skelton } from './Skelton';
|
|
|
|
|
|
|
|
import styles from './PageComment.module.scss';
|
|
import styles from './PageComment.module.scss';
|
|
|
|
|
|
|
@@ -119,13 +120,25 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
|
|
|
});
|
|
});
|
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
|
|
- if (commentsFromOldest == null || commentsExceptReply == null) return <></>;
|
|
|
|
|
|
|
+ let commentTitleClasses = 'border-bottom py-3 mb-3';
|
|
|
|
|
+ commentTitleClasses = titleAlign != null ? `${commentTitleClasses} text-${titleAlign}` : `${commentTitleClasses} text-center`;
|
|
|
|
|
|
|
|
- if (hideIfEmpty && comments?.length === 0) {
|
|
|
|
|
- return <></>;
|
|
|
|
|
- }
|
|
|
|
|
- if (rendererOptions == null || currentPagePath == null || currentPage == 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">
|
|
|
|
|
+ <div className="container-lg">
|
|
|
|
|
+ <div className={`${styles['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>
|
|
|
|
|
+ </>
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const generateCommentInnerElement = (comment: ICommentHasId) => (
|
|
const generateCommentInnerElement = (comment: ICommentHasId) => (
|
|
@@ -154,9 +167,6 @@ 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="page-comments-row comment-list mt-5 py-4 d-edit-none d-print-none">
|
|
<div className="page-comments-row comment-list mt-5 py-4 d-edit-none d-print-none">
|
|
@@ -185,7 +195,7 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
|
|
|
outline
|
|
outline
|
|
|
color="secondary"
|
|
color="secondary"
|
|
|
size="sm"
|
|
size="sm"
|
|
|
- className={`${styles['btn-comment-reply']}`}
|
|
|
|
|
|
|
+ className="btn-comment-reply"
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setShowEditorIds(previousState => new Set(previousState.add(comment._id)));
|
|
setShowEditorIds(previousState => new Set(previousState.add(comment._id)));
|
|
|
}}
|
|
}}
|