diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-11-19 07:55:13 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-11-19 07:55:13 -0500 |
commit | 7b442ea6af6b5da22faf6f652ad7f01803836f17 (patch) | |
tree | f1baec4a433821e5025926e45c3b789ae1b6b197 /web/react/components/post.jsx | |
parent | e408d615c02ae3c863df3c7dc13d1b813c22fd28 (diff) | |
parent | 3e2aba873db6cee3838930321416275b2bbce2be (diff) | |
download | chat-7b442ea6af6b5da22faf6f652ad7f01803836f17.tar.gz chat-7b442ea6af6b5da22faf6f652ad7f01803836f17.tar.bz2 chat-7b442ea6af6b5da22faf6f652ad7f01803836f17.zip |
Merge pull request #1462 from asaadmahmoodspin/postsImprovement
Posts structure improvement
Diffstat (limited to 'web/react/components/post.jsx')
-rw-r--r-- | web/react/components/post.jsx | 61 |
1 files changed, 26 insertions, 35 deletions
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx index 2b9586345..7e4af07c4 100644 --- a/web/react/components/post.jsx +++ b/web/react/components/post.jsx @@ -13,8 +13,6 @@ var AsyncClient = require('../utils/async_client.jsx'); var ActionTypes = Constants.ActionTypes; var utils = require('../utils/utils.jsx'); -var PostInfo = require('./post_info.jsx'); - export default class Post extends React.Component { constructor(props) { super(props); @@ -141,6 +139,8 @@ export default class Post extends React.Component { var postType = ''; if (type !== 'Post') { postType = 'post--comment'; + } else if (commentCount > 0) { + postType = 'post--root'; } var currentUserCss = ''; @@ -170,14 +170,11 @@ export default class Post extends React.Component { } profilePic = ( - <div className='post-profile-img__container'> - <img - className='post-profile-img' - src={src} - height='36' - width='36' - /> - </div> + <img + src={src} + height='36' + width='36' + /> ); } @@ -187,32 +184,26 @@ export default class Post extends React.Component { id={'post_' + post.id} className={'post ' + sameUserClass + ' ' + rootUser + ' ' + postType + ' ' + currentUserCss} > - {profilePic} <div className='post__content'> - <PostHeader - ref='header' - post={post} - sameRoot={this.props.sameRoot} - commentCount={commentCount} - handleCommentClick={this.handleCommentClick} - isLastComment={this.props.isLastComment} - /> - <PostBody - post={post} - sameRoot={this.props.sameRoot} - parentPost={parentPost} - posts={posts} - handleCommentClick={this.handleCommentClick} - retryPost={this.retryPost} - /> - <PostInfo - ref='info' - post={post} - sameRoot={this.props.sameRoot} - commentCount={commentCount} - handleCommentClick={this.handleCommentClick} - allowReply='true' - /> + <div className='post__img'>{profilePic}</div> + <div> + <PostHeader + ref='header' + post={post} + sameRoot={this.props.sameRoot} + commentCount={commentCount} + handleCommentClick={this.handleCommentClick} + isLastComment={this.props.isLastComment} + /> + <PostBody + post={post} + sameRoot={this.props.sameRoot} + parentPost={parentPost} + posts={posts} + handleCommentClick={this.handleCommentClick} + retryPost={this.retryPost} + /> + </div> </div> </div> </div> |