diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-29 08:40:06 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-29 08:40:06 -0400 |
commit | 1f4974dc02c786b65c802d4497fd736cca79d01c (patch) | |
tree | 1007e452c4a9345dee8aff113f28f235432bf323 /webapp/components/rhs_comment.jsx | |
parent | 9961ccca7d39bdfabbafce423d3f7fe4b6ed2f29 (diff) | |
download | chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.gz chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.bz2 chat-1f4974dc02c786b65c802d4497fd736cca79d01c.zip |
General react performance improvements (#2796)
* General React performance improvements
* Cleaned up unused props/state in PermaLinkView and PostFocusView
Diffstat (limited to 'webapp/components/rhs_comment.jsx')
-rw-r--r-- | webapp/components/rhs_comment.jsx | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index 709865dc1..290eb64c6 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -1,35 +1,32 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import ReactDOM from 'react-dom'; +import UserProfile from './user_profile.jsx'; +import FileAttachmentList from './file_attachment_list.jsx'; + import PostStore from 'stores/post_store.jsx'; import ChannelStore from 'stores/channel_store.jsx'; -import UserProfile from './user_profile.jsx'; + +import * as GlobalActions from 'action_creators/global_actions.jsx'; import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; + +import * as TextFormatting from 'utils/text_formatting.jsx'; import * as Utils from 'utils/utils.jsx'; -import Constants from 'utils/constants.jsx'; -import FileAttachmentList from './file_attachment_list.jsx'; import Client from 'utils/web_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; -var ActionTypes = Constants.ActionTypes; -import * as TextFormatting from 'utils/text_formatting.jsx'; -import twemoji from 'twemoji'; -import * as GlobalActions from 'action_creators/global_actions.jsx'; -import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedDate} from 'react-intl'; +import Constants from 'utils/constants.jsx'; +const ActionTypes = Constants.ActionTypes; -import loadingGif from 'images/load.gif'; +import {FormattedMessage, FormattedDate} from 'react-intl'; -const holders = defineMessages({ - comment: { - id: 'rhs_comment.comment', - defaultMessage: 'Comment' - } -}); +import loadingGif from 'images/load.gif'; import React from 'react'; +import ReactDOM from 'react-dom'; +import twemoji from 'twemoji'; -class RhsComment extends React.Component { +export default class RhsComment extends React.Component { constructor(props) { super(props); @@ -136,7 +133,7 @@ class RhsComment extends React.Component { data-toggle='modal' data-target='#edit_post' data-refocusid='#reply_textbox' - data-title={this.props.intl.formatMessage(holders.comment)} + data-title={Utils.localizeMessage('rhs_comment.comment', 'Comment')} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id} @@ -302,14 +299,8 @@ class RhsComment extends React.Component { } } -RhsComment.defaultProps = { - post: null -}; RhsComment.propTypes = { - intl: intlShape.isRequired, post: React.PropTypes.object, user: React.PropTypes.object.isRequired, currentUser: React.PropTypes.object.isRequired }; - -export default injectIntl(RhsComment); |