diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_view/components/post_message_container.jsx | 2 | ||||
-rw-r--r-- | webapp/components/post_view/components/post_message_view.jsx | 38 |
2 files changed, 8 insertions, 32 deletions
diff --git a/webapp/components/post_view/components/post_message_container.jsx b/webapp/components/post_view/components/post_message_container.jsx index 4e27cd29a..2d17e74c4 100644 --- a/webapp/components/post_view/components/post_message_container.jsx +++ b/webapp/components/post_view/components/post_message_container.jsx @@ -89,7 +89,7 @@ export default class PostMessageContainer extends React.Component { return ( <PostMessageView options={this.props.options} - post={this.props.post} + message={this.props.post.message} emojis={this.state.emojis} enableFormatting={this.state.enableFormatting} mentionKeys={this.state.mentionKeys} diff --git a/webapp/components/post_view/components/post_message_view.jsx b/webapp/components/post_view/components/post_message_view.jsx index eff791aec..24f96a8d9 100644 --- a/webapp/components/post_view/components/post_message_view.jsx +++ b/webapp/components/post_view/components/post_message_view.jsx @@ -2,16 +2,14 @@ // See License.txt for license information. import React from 'react'; -import {FormattedMessage} from 'react-intl'; import * as TextFormatting from 'utils/text_formatting.jsx'; import * as Utils from 'utils/utils.jsx'; -import * as PostUtils from 'utils/post_utils.jsx'; export default class PostMessageView extends React.Component { static propTypes = { options: React.PropTypes.object.isRequired, - post: React.PropTypes.object.isRequired, + message: React.PropTypes.string.isRequired, emojis: React.PropTypes.object.isRequired, enableFormatting: React.PropTypes.bool.isRequired, mentionKeys: React.PropTypes.arrayOf(React.PropTypes.string).isRequired, @@ -25,7 +23,7 @@ export default class PostMessageView extends React.Component { return true; } - if (nextProps.post.message !== this.props.post.message) { + if (nextProps.message !== this.props.message) { return true; } @@ -49,28 +47,9 @@ export default class PostMessageView extends React.Component { return false; } - editedIndicator() { - return ( - PostUtils.isEdited(this.props.post) ? - <span className='edited'> - <FormattedMessage - id='post_message_view.edited' - defaultMessage='(edited)' - /> - </span> : - '' - ); - } - render() { if (!this.props.enableFormatting) { - return ( - <span> - {this.props.post.message} - - {this.editedIndicator()} - </span> - ); + return <span>{this.props.message}</span>; } const options = Object.assign({}, this.props.options, { @@ -83,13 +62,10 @@ export default class PostMessageView extends React.Component { }); return ( - <div> - <span - onClick={Utils.handleFormattedTextClick} - dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, options)}} - /> - {this.editedIndicator()} - </div> + <span + onClick={Utils.handleFormattedTextClick} + dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.message, options)}} + /> ); } } |