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

Function LearningTrackNav

components/article/LearningTrackNav.tsx:8–48  ·  view source on GitHub ↗
({ track }: Props)

Source from the content-addressed store, hash-verified

6 track: LearningTrack
7}
8export function LearningTrackNav({ track }: Props) {
9 const { t } = useTranslation('learning_track_nav')
10 const { prevGuide, nextGuide, trackName, trackProduct } = track
11 return (
12 <div
13 data-testid="learning-track-nav"
14 className="py-3 px-4 rounded color-bg-default border d-flex flex-justify-between"
15 >
16 <span className="f5 d-flex flex-column">
17 {prevGuide && (
18 <>
19 <span className="color-fg-default">{t('prev_guide')}</span>
20 <Link
21 href={`${prevGuide.href}?learn=${trackName}&learnProduct=${trackProduct}`}
22 className="text-bold color-fg"
23 >
24 {prevGuide.title}
25 </Link>
26 </>
27 )}
28 </span>
29
30 <span className="f5 d-flex flex-column flex-items-end">
31 {nextGuide && (
32 <>
33 <span className="color-fg-default">{t('next_guide')}</span>
34 <Link
35 href={`${nextGuide.href}?${new URLSearchParams({
36 learn: trackName,
37 learnProduct: trackProduct,
38 })}`}
39 className="text-bold color-fg text-right"
40 >
41 {nextGuide.title}
42 </Link>
43 </>
44 )}
45 </span>
46 </div>
47 )
48}

Callers

nothing calls this directly

Calls 1

useTranslationFunction · 0.90

Tested by

no test coverage detected