Skip to content

Commit c0cf4cc

Browse files
authored
Merge pull request #11234 from AnilSeervi/main
Update internal footer links to be language dynamic and fix Developer API link
2 parents 6cbd313 + 6fab51a commit c0cf4cc

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

components/page-footer/SmallFooter.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1+
import Link from 'next/link'
2+
import { useRouter } from 'next/router'
13
import { MarkGithubIcon } from '@primer/octicons-react'
24
import { useTranslation } from 'components/hooks/useTranslation'
35

46
export const SmallFooter = () => {
7+
const router = useRouter()
58
const { t } = useTranslation('footer')
69
return (
710
<footer className="container-xl px-3 mt-6 mb-8 px-md-6 position-relative d-flex flex-row-reverse flex-xl-row flex-wrap flex-xl-nowrap flex-justify-center flex-xl-justify-between f6 color-fg-muted">
811
<ul className="list-style-none d-flex flex-wrap col-12 col-xl-5 flex-justify-center flex-xl-justify-between mb-2 mb-xl-0">
912
<li className="mr-3 mr-xl-0">&copy; {new Date().getFullYear()} GitHub, Inc.</li>
1013
<li className="mr-3 mr-xl-0">
11-
<a href="https://docs.github.com/en/github/site-policy/github-terms-of-service">
14+
<Link href={`/${router.locale}/github/site-policy/github-terms-of-service`}>
1215
{t('terms')}
13-
</a>
16+
</Link>
1417
</li>
1518
<li className="mr-3 mr-xl-0">
16-
<a href="https://docs.github.com/en/github/site-policy/github-privacy-statement">
19+
<Link href={`/${router.locale}/github/site-policy/github-privacy-statement`}>
1720
{t('privacy')}
18-
</a>
21+
</Link>
1922
</li>
2023
<li className="mr-3 mr-xl-0">
2124
<a href="https://github.com/security">{t('product.links.security')}</a>
@@ -24,7 +27,7 @@ export const SmallFooter = () => {
2427
<a href="https://www.githubstatus.com/">{t('support.links.status')}</a>
2528
</li>
2629
<li>
27-
<a href="/">{t('support.links.help')}</a>
30+
<Link href={`/${router.locale}`}>{t('support.links.help')}</Link>
2831
</li>
2932
</ul>
3033

@@ -45,7 +48,7 @@ export const SmallFooter = () => {
4548
<a href="https://github.com/pricing">{t('product.links.pricing')}</a>
4649
</li>
4750
<li className="mr-3 mr-xl-0">
48-
<a href="https://docs.github.com">{t('platform.links.developer_api')}</a>
51+
<Link href={`/${router.locale}/developers`}>{t('platform.links.developer_api')}</Link>
4952
</li>
5053
<li className="mr-3 mr-xl-0">
5154
<a href="https://services.github.com">{t('support.links.training')}</a>

0 commit comments

Comments
 (0)