2
0
jam411 3 жил өмнө
parent
commit
04ebe2e8b8

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

@@ -138,7 +138,7 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
     );
     );
   }
   }
 
 
-  const generateCommentInnerElement = (comment: ICommentHasId) => (
+  const generateCommentElement = (comment: ICommentHasId) => (
     <Comment
     <Comment
       comment={comment}
       comment={comment}
       isReadOnly={isReadOnly}
       isReadOnly={isReadOnly}
@@ -151,7 +151,7 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
     />
     />
   );
   );
 
 
-  const generateAllRepliesElement = (replyComments: ICommentHasIdList) => (
+  const generateReplyCommentElements = (replyComments: ICommentHasIdList) => (
     <ReplyComments
     <ReplyComments
       isReadOnly={isReadOnly}
       isReadOnly={isReadOnly}
       replyList={replyComments}
       replyList={replyComments}
@@ -181,11 +181,8 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
 
 
                 return (
                 return (
                   <div key={comment._id} className={commentThreadClasses}>
                   <div key={comment._id} className={commentThreadClasses}>
-                    {/* display comment */}
-                    {generateCommentInnerElement(comment)}
-                    {/* display reply comment */}
-                    {hasReply && generateAllRepliesElement(allReplies[comment._id])}
-                    {/* display reply button */}
+                    {generateCommentElement(comment)}
+                    {hasReply && generateReplyCommentElements(allReplies[comment._id])}
                     {(!isReadOnly && !showEditorIds.has(comment._id)) && (
                     {(!isReadOnly && !showEditorIds.has(comment._id)) && (
                       <div className="text-right">
                       <div className="text-right">
                         <Button
                         <Button
@@ -201,7 +198,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
                         </Button>
                         </Button>
                       </div>
                       </div>
                     )}
                     )}
-                    {/* display reply editor */}
                     {(!isReadOnly && showEditorIds.has(comment._id)) && (
                     {(!isReadOnly && showEditorIds.has(comment._id)) && (
                       <CommentEditor
                       <CommentEditor
                         rendererOptions={rendererOptions}
                         rendererOptions={rendererOptions}