MCPcopy Index your code
hub / github.com/github/docs / ArticlePage

Function ArticlePage

components/article/ArticlePage.tsx:32–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30const isDev = process.env.NODE_ENV === 'development'
31
32export const ArticlePage = () => {
33 const router = useRouter()
34 const {
35 title,
36 intro,
37 effectiveDate,
38 renderedPage,
39 permissions,
40 includesPlatformSpecificContent,
41 includesToolSpecificContent,
42 product,
43 productVideoUrl,
44 miniTocItems,
45 currentLearningTrack,
46 } = useArticleContext()
47 const isLearningPath = !!currentLearningTrack?.trackName
48 const { t } = useTranslation(['pages'])
49
50 return (
51 <DefaultLayout>
52 {isDev && <ClientSideRefresh />}
53 <ClientSideHighlight />
54 {router.pathname.includes('/rest/') && <RestRedirect />}
55 <div className="container-xl px-3 px-md-6 my-4">
56 <div className={cx('d-none d-xl-block mt-3 mr-auto width-full')}>
57 <Breadcrumbs />
58 </div>
59 <ArticleGridLayout
60 topper={<ArticleTitle>{title}</ArticleTitle>}
61 intro={
62 <>
63 {intro && (
64 <Lead data-testid="lead" data-search="lead">
65 {intro}
66 </Lead>
67 )}
68
69 {permissions && <PermissionsStatement permissions={permissions} />}
70
71 {includesPlatformSpecificContent && <PlatformPicker />}
72 {includesToolSpecificContent && <ToolPicker />}
73
74 {product && (
75 <Callout
76 variant="success"
77 className="mb-4"
78 dangerouslySetInnerHTML={{ __html: product }}
79 />
80 )}
81 </>
82 }
83 toc={
84 <>
85 {isLearningPath && <LearningTrackCard track={currentLearningTrack} />}
86 {miniTocItems.length > 1 && <MiniTocs miniTocItems={miniTocItems} />}
87 </>
88 }
89 >

Callers

nothing calls this directly

Calls 2

useArticleContextFunction · 0.90
useTranslationFunction · 0.90

Tested by

no test coverage detected