Skip to content

Commit

Permalink
Add label to highest-rated comment (#2177)
Browse files Browse the repository at this point in the history
  • Loading branch information
lubien authored and fregante committed Jun 26, 2019
1 parent a5dd228 commit 303b8fe
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 303b8fe

Please sign in to comment.