diff options
author | Asaad Mahmood <asaadmahmoodspin@users.noreply.github.com> | 2016-06-06 17:46:03 +0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-06-06 08:46:03 -0400 |
commit | 353216e05c84727a43445bc5c4bb79fe94dcfca4 (patch) | |
tree | d6f5b0edfd20e93635a23109aaf06bf5b844d3e3 /webapp/components/rhs_root_post.jsx | |
parent | 53a35f2f8efd34685e9ef5c8b84d9665f8479b52 (diff) | |
download | chat-353216e05c84727a43445bc5c4bb79fe94dcfca4.tar.gz chat-353216e05c84727a43445bc5c4bb79fe94dcfca4.tar.bz2 chat-353216e05c84727a43445bc5c4bb79fe94dcfca4.zip |
PLT-3182 - Improving switch channels modal and some minor UI improvements (#3238)
* PLT-3182 - Improving switch channels modal and some minor UI improvements
Enabling link previews
Adding compact layout to RHS
Improving timestamps
* Adding update code for RHS components
Diffstat (limited to 'webapp/components/rhs_root_post.jsx')
-rw-r--r-- | webapp/components/rhs_root_post.jsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx index f7c9c9141..8996381ba 100644 --- a/webapp/components/rhs_root_post.jsx +++ b/webapp/components/rhs_root_post.jsx @@ -32,6 +32,9 @@ export default class RhsRootPost extends React.Component { GlobalActions.showGetPostLinkModal(this.props.post); } shouldComponentUpdate(nextProps) { + if (nextProps.compactDisplay !== this.props.compactDisplay) { + return true; + } if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) { return true; } @@ -220,6 +223,11 @@ export default class RhsRootPost extends React.Component { ); } + let compactClass = ''; + if (this.props.compactDisplay) { + compactClass = 'post--compact'; + } + const messageWrapper = ( <div ref='message_holder' @@ -229,7 +237,7 @@ export default class RhsRootPost extends React.Component { ); return ( - <div className={'post post--root ' + userCss + ' ' + systemMessageClass}> + <div className={'post post--root post--thread ' + userCss + ' ' + systemMessageClass + ' ' + compactClass}> <div className='post-right-channel__name'>{channelName}</div> <div className='post__content'> <div className='post__img'> @@ -279,5 +287,6 @@ RhsRootPost.propTypes = { post: React.PropTypes.object.isRequired, user: React.PropTypes.object.isRequired, currentUser: React.PropTypes.object.isRequired, - commentCount: React.PropTypes.number + commentCount: React.PropTypes.number, + compactDisplay: React.PropTypes.bool }; |