({
title,
description,
icon,
textColor,
textColorDark,
backgroundColor,
backgroundColorDark,
}: DocsBannerProps)
| 26 | }; |
| 27 | |
| 28 | export default function DocsBanner({ |
| 29 | title, |
| 30 | description, |
| 31 | icon, |
| 32 | textColor, |
| 33 | textColorDark, |
| 34 | backgroundColor, |
| 35 | backgroundColorDark, |
| 36 | }: DocsBannerProps): JSX.Element { |
| 37 | const Icon = (icon && icons[icon]) || icons.documents; |
| 38 | |
| 39 | textColor ||= "var(--c-eleven-o-clock)"; // default banner text color |
| 40 | textColorDark ||= "var(--c-off-white)"; // default banner text color dark theme |
| 41 | |
| 42 | backgroundColor ||= "var(--c-dirty-socks)"; // default banner bg color |
| 43 | backgroundColorDark ||= "var(--c-primary-gray)"; // default banner bg color dark theme |
| 44 | |
| 45 | //remove the dulpicate html <header> + h1 tags within the .markdown |
| 46 | React.useEffect(() => { |
| 47 | const header = document.querySelector(".markdown > header"); |
| 48 | if (header) header.remove(); |
| 49 | }, []); |
| 50 | |
| 51 | return ( |
| 52 | <header |
| 53 | className={clsx(styles.docsBanner)} |
| 54 | style={ |
| 55 | { |
| 56 | "--text-docs-banner": textColor, |
| 57 | "--text-docs-banner-dark": textColorDark, |
| 58 | "--bg-docs-banner": backgroundColor, |
| 59 | "--bg-docs-banner-dark": backgroundColorDark, |
| 60 | } as CSSProperties |
| 61 | } |
| 62 | > |
| 63 | <div className={styles.docsBannerLeft}> |
| 64 | <h1 className="type-gamma">{title}</h1> |
| 65 | <p className="type-paragraph">{description}</p> |
| 66 | </div> |
| 67 | |
| 68 | <Icon className={styles.icon} /> |
| 69 | </header> |
| 70 | ); |
| 71 | } |
nothing calls this directly
no outgoing calls
no test coverage detected