diff --git a/webapp/components/post_view/components/post_body.jsx b/webapp/components/post_view/components/post_body.jsx index a98c92017a..348e7fc93e 100644 --- a/webapp/components/post_view/components/post_body.jsx +++ b/webapp/components/post_view/components/post_body.jsx @@ -154,26 +154,13 @@ export default class PostBody extends React.Component { } let message; - let removeButton; if (this.props.post.state === Constants.POST_DELETED) { - removeButton = ( - - {'×'} - - ); - message = (

- {removeButton}

); } else { diff --git a/webapp/components/post_view/components/post_info.jsx b/webapp/components/post_view/components/post_info.jsx index 98639529e6..9cb1e751d8 100644 --- a/webapp/components/post_view/components/post_info.jsx +++ b/webapp/components/post_view/components/post_info.jsx @@ -20,6 +20,7 @@ export default class PostInfo extends React.Component { this.handleDropdownClick = this.handleDropdownClick.bind(this); this.handlePermalink = this.handlePermalink.bind(this); + this.removePost = this.removePost.bind(this); } handleDropdownClick(e) { var position = $('#post-list').height() - $(e.target).offset().top; @@ -170,6 +171,23 @@ export default class PostInfo extends React.Component { GlobalActions.showGetPostLinkModal(this.props.post); } + removePost() { + GlobalActions.emitRemovePost(this.props.post); + } + + createRemovePostButton() { + return ( + + {'×'} + + ); + } + render() { var post = this.props.post; var comments = ''; @@ -203,7 +221,26 @@ export default class PostInfo extends React.Component { ); } - var dropdown = this.createDropdown(); + let options; + if (Utils.isPostEphemeral(post)) { + options = ( +
  • + {this.createRemovePostButton()} +
  • + ); + } else { + options = ( +
  • +
    + {this.createDropdown()} +
    + {comments} +
  • + ); + } return ( ); } diff --git a/webapp/sass/layout/_post.scss b/webapp/sass/layout/_post.scss index cb30106d4a..605c036581 100644 --- a/webapp/sass/layout/_post.scss +++ b/webapp/sass/layout/_post.scss @@ -812,6 +812,11 @@ body.ios { white-space: nowrap; } + .col__remove { + position: absolute; + right: 10px; + } + .permalink-popover { min-width: 0;