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

Function addNotice

source/github-widgets/notice-bar.tsx:12–32  ·  view source on GitHub ↗
(
	message: string | Node | Array<string | Node>,
	{
		type = 'notice',
		action = (
			<button className="flash-close js-flash-close" type="button" aria-label="Dismiss this message">
				<XIcon />
			</button>
		),
	}: Options = {},
)

Source from the content-addressed store, hash-verified

10
11/** https://primer.style/css/components/alerts */
12export default async function addNotice(
13 message: string | Node | Array<string | Node>,
14 {
15 type = 'notice',
16 action = (
17 <button className="flash-close js-flash-close" type="button" aria-label="Dismiss this message">
18 <XIcon />
19 </button>
20 ),
21 }: Options = {},
22): Promise<void> {
23 const container = await elementReady('#js-flash-container');
24 container!.append(
25 <div className={cx('flash flash-full', `flash-${type}`, 'px-4 tmp-px-3')}>
26 {action}
27 <div>
28 {message}
29 </div>
30 </div>,
31 );
32}

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected