diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-04-21 09:56:11 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-21 09:56:11 -0400 |
commit | 899ee09224799cb8b1dffaea781a18594616b50e (patch) | |
tree | e6b57b8458abd864ac92dd0074d73e9f7a5284cf /webapp/components/post.jsx | |
parent | cf1f3ba322ce64ca383ce1a5f0ca3d9bacb180ea (diff) | |
download | chat-899ee09224799cb8b1dffaea781a18594616b50e.tar.gz chat-899ee09224799cb8b1dffaea781a18594616b50e.tar.bz2 chat-899ee09224799cb8b1dffaea781a18594616b50e.zip |
Adding option to display channels sanely (#2761)
Diffstat (limited to 'webapp/components/post.jsx')
-rw-r--r-- | webapp/components/post.jsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webapp/components/post.jsx b/webapp/components/post.jsx index 7294cf163..7fabec741 100644 --- a/webapp/components/post.jsx +++ b/webapp/components/post.jsx @@ -99,6 +99,10 @@ export default class Post extends React.Component { return true; } + if (nextProps.center !== this.props.center) { + return true; + } + if (!Utils.areObjectsEqual(nextProps.user, this.props.user)) { return true; } @@ -203,13 +207,18 @@ export default class Post extends React.Component { } } + let centerClass = ''; + if (this.props.center) { + centerClass = 'center'; + } + return ( <div> <div id={'post_' + post.id} className={'post ' + sameUserClass + ' ' + rootUser + ' ' + postType + ' ' + currentUserCss + ' ' + shouldHighlightClass + ' ' + systemMessageClass} > - <div className='post__content'> + <div className={'post__content ' + centerClass}> <div className='post__img'>{profilePic}</div> <div> <PostHeader @@ -251,5 +260,6 @@ Post.propTypes = { shouldHighlight: React.PropTypes.bool, displayNameType: React.PropTypes.string, hasProfiles: React.PropTypes.bool, - currentUser: React.PropTypes.object.isRequired + currentUser: React.PropTypes.object.isRequired, + center: React.PropTypes.bool }; |