summaryrefslogtreecommitdiffstats
path: root/webapp/components/rhs_comment.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <asaadmahmood@users.noreply.github.com>2016-08-30 16:42:51 +0500
committerJoram Wilander <jwawilander@gmail.com>2016-08-30 07:42:51 -0400
commit85f8b90aeb3d475548d9da96eb14969177a1ee5f (patch)
tree71082d46e30f6442b0062bc0fc7f7f6f3bd8510d /webapp/components/rhs_comment.jsx
parentf6c183e749820567a309adca9584f23a6ea221aa (diff)
downloadchat-85f8b90aeb3d475548d9da96eb14969177a1ee5f.tar.gz
chat-85f8b90aeb3d475548d9da96eb14969177a1ee5f.tar.bz2
chat-85f8b90aeb3d475548d9da96eb14969177a1ee5f.zip
Minor UI improvements (#3904)
* PLT-3917 - Adding cross icon to remove deleted post in the RHS. * PLT-3997 - Improving the integration confirmation screen
Diffstat (limited to 'webapp/components/rhs_comment.jsx')
-rw-r--r--webapp/components/rhs_comment.jsx37
1 files changed, 34 insertions, 3 deletions
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index c9588eb33..dcd5ee37f 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -30,6 +30,7 @@ export default class RhsComment extends React.Component {
super(props);
this.handlePermalink = this.handlePermalink.bind(this);
+ this.removePost = this.removePost.bind(this);
this.flagPost = this.flagPost.bind(this);
this.unflagPost = this.unflagPost.bind(this);
@@ -41,6 +42,23 @@ export default class RhsComment extends React.Component {
GlobalActions.showGetPostLinkModal(this.props.post);
}
+ removePost() {
+ GlobalActions.emitRemovePost(this.props.post);
+ }
+
+ createRemovePostButton() {
+ return (
+ <a
+ href='#'
+ className='post__remove theme'
+ type='button'
+ onClick={this.removePost}
+ >
+ {'×'}
+ </a>
+ );
+ }
+
shouldComponentUpdate(nextProps) {
if (nextProps.status !== this.props.status) {
return true;
@@ -344,6 +362,21 @@ export default class RhsComment extends React.Component {
);
}
+ let options;
+ if (Utils.isPostEphemeral(post)) {
+ options = (
+ <li className='col col__remove'>
+ {this.createRemovePostButton()}
+ </li>
+ );
+ } else {
+ options = (
+ <li className='col col__reply'>
+ {dropdown}
+ </li>
+ );
+ }
+
return (
<div className={'post post--thread ' + currentUserCss + ' ' + compactClass}>
<div className='post__content'>
@@ -368,9 +401,7 @@ export default class RhsComment extends React.Component {
</time>
{flagTrigger}
</li>
- <li className='col col__reply'>
- {dropdown}
- </li>
+ {options}
</ul>
<div className='post__body'>
<div className={postClass}>