[PLT-6744] Add "Only visible to you" note for ephemeral messages (#6790)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-07-25 21:10:39 +02:00
коммит произвёл Christopher Speller
родитель b92d0b0024
Коммит 5840905c7f
6 изменённых файлов: 51 добавлений и 2 удалений

Просмотреть файл

@@ -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 (