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_info.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_info.jsx')
-rw-r--r-- | web/react/components/post_info.jsx | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index fffa5b19a..5446fca7a 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -74,23 +74,6 @@ export default class PostInfo extends React.Component { ); } - if (this.props.allowReply === 'true') { - dropdownContents.push( - <li - key='replyLink' - role='presentation' - > - <a - className='reply-link theme' - href='#' - onClick={this.props.handleCommentClick} - > - {'Reply'} - </a> - </li> - ); - } - if (dropdownContents.length === 0) { return ''; } @@ -99,7 +82,7 @@ export default class PostInfo extends React.Component { <div> <a href='#' - className='dropdown-toggle theme' + className='dropdown-toggle post__dropdown theme' type='button' data-toggle='dropdown' aria-expanded='false' @@ -116,23 +99,27 @@ export default class PostInfo extends React.Component { render() { var post = this.props.post; var comments = ''; - var lastCommentClass = ' comment-icon__container__hide'; - if (this.props.isLastComment) { - lastCommentClass = ' comment-icon__container__show'; + var showCommentClass = ''; + var commentCountText = this.props.commentCount; + + if (this.props.commentCount >= 1) { + showCommentClass = ' icon--show'; + } else { + commentCountText = ''; } - if (this.props.commentCount >= 1 && post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING && post.state !== Constants.POST_DELETED) { + if (post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING && post.state !== Constants.POST_DELETED) { comments = ( <a href='#' - className={'comment-icon__container theme' + lastCommentClass} + className={'comment-icon__container' + showCommentClass} onClick={this.props.handleCommentClick} > <span className='comment-icon' dangerouslySetInnerHTML={{__html: Constants.COMMENT_ICON}} /> - {this.props.commentCount} + {commentCountText} </a> ); } @@ -140,17 +127,17 @@ export default class PostInfo extends React.Component { var dropdown = this.createDropdown(); return ( - <ul className='post-header post-info'> - <li className='post-header-col'> + <ul className='post__header post__header--info'> + <li className='col'> <TimeSince eventTime={post.create_at} /> </li> - <li className='post-header-col post-header__reply'> + <li className='col col__reply'> + {comments} <div className='dropdown'> {dropdown} </div> - {comments} </li> </ul> ); |