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

Function createBanner

source/github-helpers/banner.tsx:18–46  ·  view source on GitHub ↗
(props: BannerProps)

Source from the content-addressed store, hash-verified

16// This could be a `<Banner/>` element but dom-chef doesn't pass props
17// https://github.com/vadimdemedes/dom-chef/issues/77
18export default function createBanner(props: BannerProps): JSX.Element {
19 let button: JSX.Element | undefined;
20
21 if (typeof props.action === 'string') {
22 button = (
23 <a href={props.action} className={classes}>
24 {props.buttonLabel}
25 </a>
26 );
27 } else if (typeof props.action === 'function') {
28 button = (
29 <button type="button" className={classes} onClick={props.action}>
30 {props.buttonLabel}
31 </button>
32 );
33 }
34
35 return (
36 <div className={cx('flash', props.classes)}>
37 <div className="d-sm-flex flex-items-center gap-2">
38 <div className="d-flex flex-auto flex-self-center flex-items-center gap-2">
39 {props.icon}
40 <span>{props.text}</span>
41 </div>
42 {button}
43 </div>
44 </div>
45 );
46}

Callers 8

addConversationBannerFunction · 0.85
addTagToFooterFunction · 0.85
addReleaseBannerFunction · 0.85
getDisabledReasonFunction · 0.85
addResolvedBannerFunction · 0.85
addPopularBannerFunction · 0.85
addDraftBannerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected