From 353216e05c84727a43445bc5c4bb79fe94dcfca4 Mon Sep 17 00:00:00 2001
From: Asaad Mahmood <asaadmahmoodspin@users.noreply.github.com>
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_root_post.jsx | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'webapp/components/rhs_root_post.jsx')

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
 };
-- 
cgit v1.2.3-1-g7c22

