Browse Source

props function

itizawa 6 years ago
parent
commit
03cd507686

+ 4 - 0
src/client/js/components/PageComment/Comment.jsx

@@ -91,6 +91,10 @@ class Comment extends React.Component {
       this.isCurrentRevision() ? 'label-primary' : 'label-default'}`;
   }
 
+  editBtnClickedHandler() {
+    this.props.editBtnClicked(this.props.comment);
+  }
+
   deleteBtnClickedHandler() {
     this.props.deleteBtnClicked(this.props.comment);
   }

+ 5 - 0
src/client/js/components/PageComments.jsx

@@ -62,6 +62,10 @@ class PageComments extends React.Component {
     this.props.commentContainer.retrieveComments();
   }
 
+  confirmToEditComment(comment) {
+    console.log("Pushed Edit button");
+  }
+
   confirmToDeleteComment(comment) {
     this.setState({ commentToDelete: comment });
     this.showDeleteConfirmModal();
@@ -138,6 +142,7 @@ class PageComments extends React.Component {
       <div key={commentId} className={`mb-5 ${rootClassNames}`}>
         <Comment
           comment={comment}
+          editBtnClicked={this.confirmToEditComment}
           deleteBtnClicked={this.confirmToDeleteComment}
           growiRenderer={this.growiRenderer}
           replyList={replies}