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

Add label to highest-rated comment #2177

Merged
merged 4 commits into from Jun 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/features/highest-rated-comment.tsx
Expand Up @@ -34,6 +34,14 @@ function init(): false | void {
const {hash} = select<HTMLAnchorElement>('.timestamp', event)!;

select('.unminimized-comment', event)!.classList.add('rgh-highest-rated-comment');
select('.unminimized-comment .timeline-comment-header-text', event)!.before(
<span
className="timeline-comment-label tooltipped tooltipped-n"
aria-label="This comment has the most positive reactions on this issue."
>
Highest-rated comment
</span>
);

const position = select.all('.js-comment').indexOf(highest.like.closest('.js-comment') as HTMLElement);
if (position >= 4) {
Expand Down