MCPcopy Index your code
hub / github.com/refined-github/refined-github / addResolvedBanner

Function addResolvedBanner

source/features/netiquette.tsx:74–92  ·  view source on GitHub ↗
(commentField: HTMLElement, closingDate: Date)

Source from the content-addressed store, hash-verified

72}
73
74function addResolvedBanner(commentField: HTMLElement, closingDate: Date): void {
75 if (elementExists('.rgh-resolved-banner')) {
76 return;
77 }
78
79 const reactWrapper = closestElementOptional('[class^="InlineAutocomplete"]', commentField);
80 const banner = createBanner({
81 icon: <InfoIcon className="m-0 tmp-m-0" />,
82 classes: 'm-0 p-2 text-small color-fg-muted border-0 rounded-0 rgh-resolved-banner'.split(' '),
83 text: getResolvedText(closingDate),
84 });
85
86 if (reactWrapper) {
87 reactWrapper.prepend(banner);
88 } else {
89 banner.classList.replace('rounded-0', 'm-2');
90 commentField.prepend(banner);
91 }
92}
93
94function addPopularBanner(commentField: HTMLElement): void {
95 if (elementExists('.rgh-popular-banner')) {

Callers 1

initBannerFunction · 0.85

Calls 4

createBannerFunction · 0.85
getResolvedTextFunction · 0.85
prependMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected