MCPcopy Create free account
hub / github.com/github/docs / GHAEReleaseNotePatch

Function GHAEReleaseNotePatch

components/release-notes/GHAEReleaseNotePatch.tsx:13–58  ·  view source on GitHub ↗
({ patch, currentVersion, didEnterView }: Props)

Source from the content-addressed store, hash-verified

11
12type Props = { patch: ReleaseNotePatch; currentVersion: CurrentVersion; didEnterView: () => void }
13export function GHAEReleaseNotePatch({ patch, currentVersion, didEnterView }: Props) {
14 const { t } = useTranslation('release_notes')
15 const containerRef = useRef<HTMLDivElement>(null)
16 const onScreen = useOnScreen(containerRef, { rootMargin: '-40% 0px -50%' })
17 useEffect(() => {
18 if (onScreen) {
19 didEnterView()
20 }
21 }, [onScreen])
22
23 const bannerText = t('banner_text')
24
25 return (
26 <div
27 ref={containerRef}
28 className={cx(styles.sectionHeading, 'mb-10 pb-6 border-bottom border-top')}
29 id={patch.release}
30 >
31 <header style={{ zIndex: 1 }} className="container-xl border-bottom px-3 pt-4 pb-2">
32 <div className="d-flex flex-items-center">
33 <h2 className="border-bottom-0 m-0 p-0">
34 {currentVersion.versionTitle} {patch.release}
35 </h2>
36
37 {patch.release_candidate && (
38 <span
39 className="IssueLabel color-bg-attention-emphasis color-fg-on-emphasis ml-3"
40 style={{ whiteSpace: 'pre' }}
41 >
42 Release Candidate
43 </span>
44 )}
45 </div>
46 <p className="color-fg-muted mt-1">
47 {bannerText} {dayjs(patch.date).format('MMMM DD, YYYY')}.
48 </p>
49 </header>
50
51 <div className="container-xl px-3">
52 <div className="mt-3" dangerouslySetInnerHTML={{ __html: patch.intro }} />
53
54 <PatchNotes patch={patch} />
55 </div>
56 </div>
57 )
58}

Callers

nothing calls this directly

Calls 2

useTranslationFunction · 0.90
useOnScreenFunction · 0.90

Tested by

no test coverage detected