diff options
Diffstat (limited to 'ui/src/components/comment-node.tsx')
-rw-r--r-- | ui/src/components/comment-node.tsx | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 839a01dc..a6b9b7ba 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -32,6 +32,7 @@ import { MomentTime } from './moment-time'; import { CommentForm } from './comment-form'; import { CommentNodes } from './comment-nodes'; import { UserListing } from './user-listing'; +import { CommunityLink } from './community-link'; import { i18n } from '../i18next'; interface CommentNodeState { @@ -158,9 +159,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { id: node.comment.creator_id, local: node.comment.creator_local, actor_id: node.comment.creator_actor_id, + published: node.comment.creator_published, }} /> </span> + {this.isMod && ( <div className="badge badge-light d-none d-sm-inline mr-2"> {i18n.t('mod')} @@ -184,13 +187,22 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { {this.props.showCommunity && ( <> <span class="mx-1">{i18n.t('to')}</span> - <Link class="mr-2" to={`/c/${node.comment.community_name}`}> - {node.comment.community_name} + <CommunityLink + community={{ + name: node.comment.community_name, + id: node.comment.community_id, + local: node.comment.community_local, + actor_id: node.comment.community_actor_id, + }} + /> + <span class="mx-2">•</span> + <Link class="mr-2" to={`/post/${node.comment.post_id}`}> + {node.comment.post_name} </Link> </> )} - <div - className="mr-lg-4 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" + <button + class="btn btn-sm text-muted" onClick={linkEvent(this, this.handleCommentCollapse)} > {this.state.collapsed ? ( @@ -202,9 +214,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { <use xlinkHref="#icon-minus-square"></use> </svg> )} - </div> - <span - className={`unselectable pointer ${this.scoreColor}`} + </button> + {/* This is an expanding spacer for mobile */} + <div className="mr-lg-4 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div> + <button + className={`btn btn-sm p-0 unselectable pointer ${this.scoreColor}`} onClick={linkEvent(node, this.handleCommentUpvote)} data-tippy-content={this.pointsTippy} > @@ -212,7 +226,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { <use xlinkHref="#icon-zap"></use> </svg> <span class="mr-1">{this.state.score}</span> - </span> + </button> <span className="mr-1">•</span> <span> <MomentTime data={node.comment} /> @@ -225,6 +239,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { edit onReplyCancel={this.handleReplyCancel} disabled={this.props.locked} + focus /> )} {!this.state.showEdit && !this.state.collapsed && ( @@ -693,6 +708,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { node={node} onReplyCancel={this.handleReplyCancel} disabled={this.props.locked} + focus /> )} {node.children && !this.state.collapsed && ( |