summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-07-28 13:38:15 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-07-28 13:38:15 -0400
commit6dc7ea6ab267b18193a9a5a034d0762a7b1cce6c (patch)
tree15bff6747272c8125bc161d054736e2b2f2ac819 /webapp
parent5a1ce3695dfcd2146271c9bad83d18a2abb5106b (diff)
downloadchat-6dc7ea6ab267b18193a9a5a034d0762a7b1cce6c.tar.gz
chat-6dc7ea6ab267b18193a9a5a034d0762a7b1cce6c.tar.bz2
chat-6dc7ea6ab267b18193a9a5a034d0762a7b1cce6c.zip
PLT-3553 Fix System messages show an empty box (#3689)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/components/post_body.jsx13
-rw-r--r--webapp/components/post_view/components/post_info.jsx49
-rw-r--r--webapp/sass/layout/_post.scss5
3 files changed, 44 insertions, 23 deletions
diff --git a/webapp/components/post_view/components/post_body.jsx b/webapp/components/post_view/components/post_body.jsx
index a98c92017..348e7fc93 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 = (
- <a
- href='#'
- className='post__remove theme'
- type='button'
- onClick={this.removePost}
- >
- {'×'}
- </a>
- );
-
message = (
<p>
<FormattedMessage
id='post_body.deleted'
defaultMessage='(message deleted)'
/>
- {removeButton}
</p>
);
} else {
diff --git a/webapp/components/post_view/components/post_info.jsx b/webapp/components/post_view/components/post_info.jsx
index 98639529e..9cb1e751d 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 (
+ <a
+ href='#'
+ className='post__remove theme'
+ type='button'
+ onClick={this.removePost}
+ >
+ {'×'}
+ </a>
+ );
+ }
+
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 = (
+ <li className='col col__remove'>
+ {this.createRemovePostButton()}
+ </li>
+ );
+ } else {
+ options = (
+ <li className='col col__reply'>
+ <div
+ className='dropdown'
+ ref='dotMenu'
+ >
+ {this.createDropdown()}
+ </div>
+ {comments}
+ </li>
+ );
+ }
return (
<ul className='post__header--info'>
@@ -215,15 +252,7 @@ export default class PostInfo extends React.Component {
useMilitaryTime={this.props.useMilitaryTime}
/>
</li>
- <li className='col col__reply'>
- <div
- className='dropdown'
- ref='dotMenu'
- >
- {dropdown}
- </div>
- {comments}
- </li>
+ {options}
</ul>
);
}
diff --git a/webapp/sass/layout/_post.scss b/webapp/sass/layout/_post.scss
index cb30106d4..605c03658 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;