summaryrefslogtreecommitdiff
path: root/source/features/clean-repo-sidebar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'source/features/clean-repo-sidebar.tsx')
-rw-r--r--source/features/clean-repo-sidebar.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/features/clean-repo-sidebar.tsx b/source/features/clean-repo-sidebar.tsx
index 313a3b06..a941d3b1 100644
--- a/source/features/clean-repo-sidebar.tsx
+++ b/source/features/clean-repo-sidebar.tsx
@@ -1,5 +1,5 @@
import './clean-repo-sidebar.css';
-import select from 'select-dom';
+import {$, elementExists} from 'select-dom';
import domLoaded from 'dom-loaded';
import elementReady from 'element-ready';
import * as pageDetect from 'github-url-detection';
@@ -15,7 +15,7 @@ async function cleanReleases(): Promise<void> {
}
const releasesSection = sidebarReleases.closest('.BorderGrid-cell')!;
- if (!select.exists('.octicon-tag', releasesSection)) {
+ if (!elementExists('.octicon-tag', releasesSection)) {
// Hide the whole section if there's no releases
releasesSection.hidden = true;
return;
@@ -39,7 +39,7 @@ async function hideEmptyPackages(): Promise<void> {
async function hideLanguageHeader(): Promise<void> {
await domLoaded;
- const lastSidebarHeader = select('.Layout-sidebar .BorderGrid-row:last-of-type h2');
+ const lastSidebarHeader = $('.Layout-sidebar .BorderGrid-row:last-of-type h2');
if (lastSidebarHeader?.textContent === 'Languages') {
lastSidebarHeader.hidden = true;
}
@@ -50,17 +50,17 @@ async function hideEmptyMeta(): Promise<void> {
await domLoaded;
if (!pageDetect.canUserEditRepo()) {
- select('.Layout-sidebar .BorderGrid-cell > .text-italic')?.remove();
+ $('.Layout-sidebar .BorderGrid-cell > .text-italic')?.remove();
}
}
async function moveReportLink(): Promise<void> {
await domLoaded;
- const reportLink = select('.Layout-sidebar a[href^="/contact/report-content"]')?.parentElement;
+ const reportLink = $('.Layout-sidebar a[href^="/contact/report-content"]')?.parentElement;
if (reportLink) {
// Your own repos don't include this link
- select('.Layout-sidebar .BorderGrid-row:last-of-type .BorderGrid-cell')!.append(reportLink);
+ $('.Layout-sidebar .BorderGrid-row:last-of-type .BorderGrid-cell')!.append(reportLink);
}
}