summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_message_view
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view/post_message_view')
-rw-r--r--webapp/components/post_view/post_message_view/post_message_view.jsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/webapp/components/post_view/post_message_view/post_message_view.jsx b/webapp/components/post_view/post_message_view/post_message_view.jsx
index 76037741f..1c6035df9 100644
--- a/webapp/components/post_view/post_message_view/post_message_view.jsx
+++ b/webapp/components/post_view/post_message_view/post_message_view.jsx
@@ -61,7 +61,12 @@ export default class PostMessageView extends React.PureComponent {
/*
* Post identifiers for selenium tests
*/
- lastPostCount: PropTypes.number
+ lastPostCount: PropTypes.number,
+
+ /**
+ * Set to render post body compactly
+ */
+ compactDisplay: PropTypes.bool
};
static defaultProps = {
@@ -167,7 +172,13 @@ export default class PostMessageView extends React.PureComponent {
postId = Utils.createSafeId('lastPostMessageText' + this.props.lastPostCount);
}
- const htmlFormattedText = TextFormatting.formatText(this.props.post.message, options);
+ let message = this.props.post.message;
+ const isEphemeral = Utils.isPostEphemeral(this.props.post);
+ if (this.props.compactDisplay && isEphemeral) {
+ const visibleMessage = Utils.localizeMessage('post_info.message.visible.compact', ' (Only visible to you)');
+ message = message.concat(visibleMessage);
+ }
+ const htmlFormattedText = TextFormatting.formatText(message, options);
const postMessageComponent = this.postMessageHtmlToComponent(htmlFormattedText);
return (