jam411 3 yıl önce
ebeveyn
işleme
f45c6c8709

+ 11 - 5
packages/app/src/components/PageComment.tsx

@@ -129,22 +129,27 @@ export const PageComment:FC<Props> = memo((props:Props):JSX.Element => {
 
   const generateCommentInnerElement = (comment: ICommentHasId) => (
     <Comment
-      rendererOptions={rendererOptions}
-      deleteBtnClicked={onClickDeleteButton}
       comment={comment}
-      onComment={mutate}
       isReadOnly={isReadOnly}
+      deleteBtnClicked={onClickDeleteButton}
+      onComment={mutate}
+      rendererOptions={rendererOptions}
       currentPagePath={currentPagePath}
       currentRevisionId={currentPage.revision._id}
-      currentRevisionCreatedAt={currentPage.revision.createdAt} />
+      currentRevisionCreatedAt={currentPage.revision.createdAt}
+    />
   );
 
   const generateAllRepliesElement = (replyComments: ICommentHasIdList) => (
     <ReplayComments
-      deleteBtnClicked={onClickDeleteButton}
       isReadOnly={isReadOnly}
       replyList={replyComments}
+      deleteBtnClicked={onClickDeleteButton}
       onComment={mutate}
+      rendererOptions={rendererOptions}
+      currentPagePath={currentPagePath}
+      currentRevisionId={currentPage.revision._id}
+      currentRevisionCreatedAt={currentPage.revision.createdAt}
     />
   );
 
@@ -191,6 +196,7 @@ export const PageComment:FC<Props> = memo((props:Props):JSX.Element => {
                     {/* display reply editor */}
                     {(!isReadOnly && showEditorIds.has(comment._id)) && (
                       <CommentEditor
+                        rendererOptions={rendererOptions}
                         replyTo={comment._id}
                         onCancelButtonClicked={() => {
                           removeShowEditorId(comment._id);

+ 1 - 2
packages/app/src/components/PageComment/Comment.tsx

@@ -118,10 +118,9 @@ export const Comment = (props: CommentProps): JSX.Element => {
       {(isReEdit && !isReadOnly) ? (
         <CommentEditor
           rendererOptions={rendererOptions}
+          replyTo={undefined}
           currentCommentId={commentId}
           commentBody={comment.comment}
-          replyTo={undefined}
-          commentCreator={creator?.username}
           onCancelButtonClicked={() => setIsReEdit(false)}
           onCommentButtonClicked={() => {
             setIsReEdit(false);

+ 1 - 1
packages/app/src/components/PageComment/CommentEditor.tsx

@@ -216,7 +216,7 @@ export const CommentEditor = (props: PropsType): JSX.Element => {
         path={currentPagePath}
       />
     );
-  }, [currentPagePath, markdown]);
+  }, [currentPagePath, markdown, rendererOptions]);
 
   const renderBeforeReady = useCallback((): JSX.Element => {
     return (

+ 2 - 3
packages/app/src/components/PageComment/ReplayComments.tsx

@@ -11,7 +11,6 @@ import { useIsAllReplyShown } from '../../stores/context';
 import { Comment } from './Comment';
 
 type ReplaycommentsProps = {
-  comment: ICommentHasId,
   isReadOnly: boolean,
   replyList: ICommentHasIdList,
   deleteBtnClicked: (comment: ICommentHasId) => void,
@@ -24,7 +23,7 @@ type ReplaycommentsProps = {
 
 export const ReplayComments = (props: ReplaycommentsProps): JSX.Element => {
   const {
-    comment, isReadOnly, replyList, deleteBtnClicked, onComment, rendererOptions,
+    isReadOnly, replyList, deleteBtnClicked, onComment, rendererOptions,
     currentPagePath, currentRevisionId, currentRevisionCreatedAt,
   } = props;
   const { data: isAllReplyShown } = useIsAllReplyShown();
@@ -37,7 +36,7 @@ export const ReplayComments = (props: ReplaycommentsProps): JSX.Element => {
         <Comment
           rendererOptions={rendererOptions}
           deleteBtnClicked={deleteBtnClicked}
-          comment={comment}
+          comment={reply}
           onComment={onComment}
           isReadOnly={isReadOnly}
           currentPagePath={currentPagePath}