diff --git a/webapp/components/post_view/components/post_info.jsx b/webapp/components/post_view/components/post_info.jsx
index b9abf7f7be33a..509809c8ce67d 100644
--- a/webapp/components/post_view/components/post_info.jsx
+++ b/webapp/components/post_view/components/post_info.jsx
@@ -152,42 +152,42 @@ export default class PostInfo extends React.Component {
);
- }
- if (this.props.post.is_pinned) {
- dropdownContents.push(
-
-
-
-
-
- );
- } else {
- dropdownContents.push(
-
-
+
+
+
+ );
+ } else {
+ dropdownContents.push(
+
-
-
-
- );
+
+
+
+
+ );
+ }
}
if (this.canDelete) {
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index fe0f139fa95fd..6dd01bd8b8011 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -151,7 +151,7 @@ export default class RhsComment extends React.Component {
unpinPost(this.props.post.channel_id, this.props.post.id);
}
- createDropdown() {
+ createDropdown(isSystemMessage) {
const post = this.props.post;
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING) {
@@ -201,57 +201,59 @@ export default class RhsComment extends React.Component {
}
}
- dropdownContents.push(
-
-
-
-
-
- );
-
- if (post.is_pinned) {
+ if (!isSystemMessage) {
dropdownContents.push(
);
- } else {
- dropdownContents.push(
-
-
-
-
-
- );
+
+
+
+
+ );
+ } else {
+ dropdownContents.push(
+
+
+
+
+
+ );
+ }
}
if (this.canDelete) {
@@ -362,15 +364,10 @@ export default class RhsComment extends React.Component {
const post = this.props.post;
const flagIcon = Constants.FLAG_ICON_SVG;
const mattermostLogo = Constants.MATTERMOST_ICON_SVG;
- const isSystemMessage = PostUtils.isSystemMessage(post);
- let canReact = false;
- if (post.state !== Constants.POST_FAILED &&
- post.state !== Constants.POST_LOADING &&
- !Utils.isPostEphemeral(post) &&
- Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) {
- canReact = true;
- }
+ const isEphemeral = Utils.isPostEphemeral(post);
+ const isPending = post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING;
+ const isSystemMessage = PostUtils.isSystemMessage(post);
var currentUserCss = '';
if (this.props.currentUser.id === post.user_id) {
@@ -412,7 +409,7 @@ export default class RhsComment extends React.Component {
}
botIndicator = {'BOT'};
- } else if (PostUtils.isSystemMessage(post)) {
+ } else if (isSystemMessage) {
userProfile = (
{this.createRemovePostButton()}
);
- } else if (!PostUtils.isSystemMessage(post)) {
+ } else if (!isSystemMessage) {
options = (
{reactOverlay}
- {this.createDropdown()}
+ {this.createDropdown(isSystemMessage)}
{react}
);
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx
index 7ce3eb3bbf8c0..9a9f83f0caa4f 100644
--- a/webapp/components/rhs_root_post.jsx
+++ b/webapp/components/rhs_root_post.jsx
@@ -295,57 +295,59 @@ export default class RhsRootPost extends React.Component {
}
}
- dropdownContents.push(
-
-
-
-
-
- );
-
- if (post.is_pinned) {
+ if (!isSystemMessage) {
dropdownContents.push(
);
- } else {
- dropdownContents.push(
-
-
-
-
-
- );
+
+
+
+
+ );
+ } else {
+ dropdownContents.push(
+
+
+
+
+
+ );
+ }
}
if (this.canDelete) {