(commentField: HTMLElement)
| 92 | } |
| 93 | |
| 94 | function addPopularBanner(commentField: HTMLElement): void { |
| 95 | if (elementExists('.rgh-popular-banner')) { |
| 96 | return; |
| 97 | } |
| 98 | |
| 99 | const reactWrapper = closestElementOptional('[class^="InlineAutocomplete"]', commentField); |
| 100 | const banner = createBanner({ |
| 101 | icon: <FlameIcon className="m-0 tmp-m-0" />, |
| 102 | classes: 'p-2 text-small color-fg-muted border-0 rounded-0 rgh-popular-banner'.split(' '), |
| 103 | text: |
| 104 | 'This issue is highly active. Reconsider commenting unless you have read all the comments and have something to add.', |
| 105 | }); |
| 106 | |
| 107 | if (reactWrapper) { |
| 108 | reactWrapper.prepend(banner); |
| 109 | } else { |
| 110 | banner.classList.replace('rounded-0', 'm-2'); |
| 111 | commentField.prepend(banner); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | function addDraftBanner(commentField: HTMLElement): void { |
| 116 | commentField.prepend( |
no test coverage detected