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_comment.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_comment.jsx')
-rw-r--r-- | webapp/components/rhs_comment.jsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index a49a84b88..0ef2348d0 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -35,6 +35,9 @@ export default class RhsComment 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; } @@ -186,6 +189,11 @@ export default class RhsComment extends React.Component { ); } + let compactClass = ''; + if (this.props.compactDisplay) { + compactClass = 'post--compact'; + } + var dropdown = this.createDropdown(); var fileAttachment; @@ -195,12 +203,13 @@ export default class RhsComment extends React.Component { filenames={post.filenames} channelId={post.channel_id} userId={post.user_id} + compactDisplay={this.props.compactDisplay} /> ); } return ( - <div className={'post ' + currentUserCss}> + <div className={'post post--thread ' + currentUserCss + ' ' + compactClass}> <div className='post__content'> <div className='post__img'> <img @@ -249,5 +258,6 @@ export default class RhsComment extends React.Component { RhsComment.propTypes = { post: React.PropTypes.object, user: React.PropTypes.object.isRequired, - currentUser: React.PropTypes.object.isRequired + currentUser: React.PropTypes.object.isRequired, + compactDisplay: React.PropTypes.bool }; |