Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving comment link to top bar. Fixes #307 #336

Merged
merged 1 commit into from
Jul 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/shared/components/comment-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
<Icon icon="minus-square" classes="icon-inline" />
)}
</button>
{this.linkBtn(true)}
{/* This is an expanding spacer for mobile */}
<div className="mr-lg-4 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div>
<div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div>
{showScores() && (
<>
<a
Expand Down Expand Up @@ -250,7 +251,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
/>
)}
<div class="d-flex justify-content-between justify-content-lg-start flex-wrap text-muted font-weight-bold">
{this.props.showContext && this.linkBtn}
{this.props.showContext && this.linkBtn()}
{this.props.markable && (
<button
class="btn btn-link btn-animate text-muted"
Expand Down Expand Up @@ -342,7 +343,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
</Link>
</button>
)}
{!this.props.showContext && this.linkBtn}
<button
class="btn btn-link btn-animate text-muted"
onClick={linkEvent(
Expand Down Expand Up @@ -805,11 +805,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
: cv.comment.read;
}

get linkBtn() {
linkBtn(small = false) {
let cv = this.props.node.comment_view;
return (
<Link
className="btn btn-link btn-animate text-muted"
className={`btn ${small && "btn-sm"} btn-link btn-animate text-muted`}
to={`/post/${cv.post.id}/comment/${cv.comment.id}`}
title={this.props.showContext ? i18n.t("show_context") : i18n.t("link")}
>
Expand Down