|
@@ -19,9 +19,9 @@ import DeleteCommentModal from './PageComment/DeleteCommentModal';
|
|
|
import { ReplayComments } from './PageComment/ReplayComments';
|
|
import { ReplayComments } from './PageComment/ReplayComments';
|
|
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
|
- isReadOnly : boolean,
|
|
|
|
|
|
|
+ isReadOnly: boolean,
|
|
|
titleAlign?: 'center' | 'left' | 'right',
|
|
titleAlign?: 'center' | 'left' | 'right',
|
|
|
- highlightKeywords?:string[],
|
|
|
|
|
|
|
+ highlightKeywords?: string[],
|
|
|
hideIfEmpty?: boolean,
|
|
hideIfEmpty?: boolean,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -60,7 +60,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
|
|
|
}, [highlightKeywords]);
|
|
}, [highlightKeywords]);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
-
|
|
|
|
|
if (comments != null) {
|
|
if (comments != null) {
|
|
|
const preprocessedCommentList: string[] = comments.map((comment) => {
|
|
const preprocessedCommentList: string[] = comments.map((comment) => {
|
|
|
const highlightedComment: string = highlightComment(comment.comment);
|
|
const highlightedComment: string = highlightComment(comment.comment);
|
|
@@ -71,7 +70,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
|
|
|
});
|
|
});
|
|
|
setFormatedComments(preprocessedComments);
|
|
setFormatedComments(preprocessedComments);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}, [comments, highlightComment]);
|
|
}, [comments, highlightComment]);
|
|
|
|
|
|
|
|
if (commentsFromOldest != null) {
|
|
if (commentsFromOldest != null) {
|
|
@@ -117,7 +115,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
|
|
|
});
|
|
});
|
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if (commentsFromOldest == null || commentsExceptReply == null) return <></>;
|
|
if (commentsFromOldest == null || commentsExceptReply == null) return <></>;
|
|
|
|
|
|
|
|
if (hideIfEmpty && comments?.length === 0) {
|
|
if (hideIfEmpty && comments?.length === 0) {
|