summaryrefslogtreecommitdiff
path: root/source/features/linkify-notification-repository-header.tsx
blob: c89eeb69d90bd4efa93dc4591e647d0f1170c8dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'dom-chef';
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';

import features from '.';

function init(): void {
	for (const header of select.all('.js-notifications-group h6')) {
		header.append(
			<a className="color-fg-inherit" href={'/' + header.textContent!.trim()}>
				{header.firstChild}
			</a>,
		);
	}
}

void features.add(import.meta.url, {
	include: [
		pageDetect.isNotifications,
	],
	exclude: [
		pageDetect.isBlank, // Empty notification list
	],
	init,
});