MCPcopy
hub / github.com/refined-github/refined-github / getDropdown

Function getDropdown

source/features/list-prs-for-file.tsx:29–76  ·  view source on GitHub ↗
(prs: number[])

Source from the content-addressed store, hash-verified

27let count = 0;
28
29function getDropdown(prs: number[]): HTMLElement {
30 const isEditing = pageDetect.isEditingFile();
31 const icon = isEditing
32 ? <AlertIcon className="color-fg-attention" />
33 : <GitPullRequestIcon />;
34
35 count++;
36 return (
37 <div>
38 <button
39 type="button"
40 className="Button Button--secondary color-fg-muted"
41 id={buttonId + count}
42 // @ts-expect-error HTML standard
43 popovertarget={buttonId + 'popover-' + count}
44 >
45 {icon}
46 <span className="color-fg-default"> {prs.length} </span>
47 <div className="dropdown-caret" />
48 </button>
49
50 <anchored-position
51 id={buttonId + 'popover-' + count}
52 anchor={buttonId + count}
53 popover="auto"
54 >
55 <div className="Overlay Overlay--size-auto">
56 <div className="px-3 tmp-px-3 pt-3 tmp-pt-3 h6 color-fg-muted">
57 File also being edited in
58 </div>
59 <ul className="ActionListWrap ActionListWrap--inset">
60 {prs.map(prNumber => (
61 <li className="ActionListItem">
62 <a
63 className="ActionListContent js-hovercard-left"
64 href={getPrUrl(prNumber)}
65 data-hovercard-url={getHovercardUrl(prNumber)}
66 >
67 #{prNumber}
68 </a>
69 </li>
70 ))}
71 </ul>
72 </div>
73 </anchored-position>
74 </div>
75 );
76}
77
78/**
79@returns prsByFile {"filename1": [10, 3], "filename2": [2]}

Callers 1

addFunction · 0.85

Calls 2

getHovercardUrlFunction · 0.85
getPrUrlFunction · 0.70

Tested by

no test coverage detected