From 353216e05c84727a43445bc5c4bb79fe94dcfca4 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Mon, 6 Jun 2016 17:46:03 +0500 Subject: 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 --- webapp/components/rhs_comment.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'webapp/components/rhs_comment.jsx') 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 ( -
+