import React from 'dom-chef'; import elementReady from 'element-ready'; import features from '.'; import {wrapAll} from '../helpers/dom-utils'; async function init(): Promise { const [, currentFeature] = /features\/([^.]+)/.exec(location.pathname)!; const feature = features.meta.find(feature => feature.id === currentFeature); if (!feature) { return false; } const conversationsUrl = '/sindresorhus/refined-github/issues?q=' + encodeURIComponent(`"${feature.id}" sort:updated-desc`); const commitInfoBox = (await elementReady('.hx_commit-tease, include-fragment.commit-loader'))!.parentElement!; commitInfoBox.classList.add('width-fit', 'min-width-0', 'flex-auto', 'mb-lg-0', 'mr-lg-3'); commitInfoBox.classList.remove('flex-shrink-0'); const featureInfoBox = (
{feature.screenshot && ( )}
{ /* eslint-disable-next-line react/no-danger */ }
); wrapAll([commitInfoBox, featureInfoBox],
); } void features.add(__filebasename, { include: [ () => /refined-github\/blob\/.+?\/source\/features\/[\w.-]+$/.test(location.pathname), ], awaitDomReady: false, deduplicate: '.rgh-feature-description', // #3945 init, });