From db1fd88870f3e9eb34d83e0fbacc9f0de93edd60 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 28 Mar 2019 23:03:17 -0700 Subject: [PATCH] Adding delete comment - Fixes #9 --- ui/src/components/post.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index c5c8a53fc..1cd61ea31 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -267,6 +267,11 @@ export class CommentNode extends Component { edit } + {this.myComment && +
  • + delete +
  • + }
  • link
  • @@ -294,6 +299,17 @@ export class CommentNode extends Component { i.setState(i.state); } + handleDeleteClick(i: CommentNode, event) { + let deleteForm: CommentFormI = { + content: "*deleted*", + edit_id: i.props.node.comment.id, + post_id: i.props.node.comment.post_id, + parent_id: i.props.node.comment.parent_id, + auth: null + }; + WebSocketService.Instance.editComment(deleteForm); + } + handleReplyCancel(): any { this.state.showReply = false; this.state.showEdit = false;