diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-05-27 16:01:28 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-27 16:01:28 -0400 |
commit | 6399a94ce221be3d15e7132654c28cd953075ec6 (patch) | |
tree | 4b1927fdd8374e8bd3cb809ecb720f2689043358 /webapp/components/post_header.jsx | |
parent | ca9f348be6bf62fc888df9a710c9af155872528e (diff) | |
download | chat-6399a94ce221be3d15e7132654c28cd953075ec6.tar.gz chat-6399a94ce221be3d15e7132654c28cd953075ec6.tar.bz2 chat-6399a94ce221be3d15e7132654c28cd953075ec6.zip |
PLT-2672 Refactored posts view with caching (#3054)
* Refactored posts view to use view controller design
* Add post view caching
* Required updates after rebase
* Fixed bug where current channel not set yet was causing breakage
Diffstat (limited to 'webapp/components/post_header.jsx')
-rw-r--r-- | webapp/components/post_header.jsx | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/webapp/components/post_header.jsx b/webapp/components/post_header.jsx deleted file mode 100644 index 6fae092e5..000000000 --- a/webapp/components/post_header.jsx +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import UserProfile from './user_profile.jsx'; -import PostInfo from './post_info.jsx'; -import * as Utils from 'utils/utils.jsx'; - -import Constants from 'utils/constants.jsx'; - -import React from 'react'; - -export default class PostHeader extends React.Component { - constructor(props) { - super(props); - this.state = {}; - } - - render() { - const post = this.props.post; - - let userProfile = <UserProfile user={this.props.user}/>; - let botIndicator; - - if (post.props && post.props.from_webhook) { - if (post.props.override_username && global.window.mm_config.EnablePostUsernameOverride === 'true') { - userProfile = ( - <UserProfile - user={this.props.user} - overwriteName={post.props.override_username} - disablePopover={true} - /> - ); - } - - botIndicator = <li className='col col__name bot-indicator'>{Constants.BOT_NAME}</li>; - } else if (Utils.isSystemMessage(post)) { - userProfile = ( - <UserProfile - user={{}} - overwriteName={Constants.SYSTEM_MESSAGE_PROFILE_NAME} - overwriteImage={Constants.SYSTEM_MESSAGE_PROFILE_IMAGE} - disablePopover={true} - /> - ); - } - - return ( - <ul className='post__header'> - <li className='col col__name'>{userProfile}</li> - {botIndicator} - <li className='col'> - <PostInfo - post={post} - commentCount={this.props.commentCount} - handleCommentClick={this.props.handleCommentClick} - allowReply='true' - isLastComment={this.props.isLastComment} - sameUser={this.props.sameUser} - currentUser={this.props.currentUser} - compactDisplay={this.props.compactDisplay} - /> - </li> - </ul> - ); - } -} - -PostHeader.defaultProps = { - post: null, - commentCount: 0, - isLastComment: false, - sameUser: false -}; -PostHeader.propTypes = { - post: React.PropTypes.object.isRequired, - user: React.PropTypes.object, - currentUser: React.PropTypes.object.isRequired, - commentCount: React.PropTypes.number.isRequired, - isLastComment: React.PropTypes.bool.isRequired, - handleCommentClick: React.PropTypes.func.isRequired, - sameUser: React.PropTypes.bool.isRequired, - compactDisplay: React.PropTypes.bool -}; |