(ownerLabel: HTMLElement)
| 9 | import observe from '../helpers/selector-observer.js'; |
| 10 | |
| 11 | async function add(ownerLabel: HTMLElement): Promise<void> { |
| 12 | // TODO [2026-07-01]: Drop |
| 13 | const isOldNavbar = ownerLabel.classList.contains('AppHeader-context-item-label'); |
| 14 | |
| 15 | const username = getRepo()!.owner; |
| 16 | const size = 16; |
| 17 | const source = getUserAvatar(username, size)!; |
| 18 | |
| 19 | const avatar = ( |
| 20 | <img |
| 21 | className={cx('d-none d-md-block avatar mr-2 tmp-mr-2', isOldNavbar && 'ml-1 tmp-ml-1')} |
| 22 | src={source} |
| 23 | width={size} |
| 24 | height={size} |
| 25 | alt={`@${username}`} |
| 26 | /> |
| 27 | ); |
| 28 | |
| 29 | (isOldNavbar ? ownerLabel : ownerLabel.parentElement!).classList.add('d-flex', 'flex-items-center'); |
| 30 | |
| 31 | ownerLabel.prepend(avatar); |
| 32 | |
| 33 | if (!pageDetect.isOrganizationRepo()) { |
| 34 | avatar.classList.add('avatar-user'); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | function init(signal: AbortSignal): void { |
| 39 | observe( |
nothing calls this directly
no test coverage detected