mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-04 04:37:28 +02:00
feat(v2): add icon to external footer links (#5092)
This commit is contained in:
parent
e5916dc596
commit
1cecd78f25
1 changed files with 10 additions and 1 deletions
|
@ -11,8 +11,10 @@ import clsx from 'clsx';
|
|||
import Link from '@docusaurus/Link';
|
||||
import {FooterLinkItem, useThemeConfig} from '@docusaurus/theme-common';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import isInternalUrl from '@docusaurus/isInternalUrl';
|
||||
import styles from './styles.module.css';
|
||||
import ThemedImage, {Props as ThemedImageProps} from '@theme/ThemedImage';
|
||||
import IconExternalLink from '@theme/IconExternalLink';
|
||||
|
||||
function FooterLink({
|
||||
to,
|
||||
|
@ -35,7 +37,14 @@ function FooterLink({
|
|||
to: toUrl,
|
||||
})}
|
||||
{...props}>
|
||||
{label}
|
||||
{href && !isInternalUrl(href) ? (
|
||||
<span>
|
||||
{label}
|
||||
<IconExternalLink />
|
||||
</span>
|
||||
) : (
|
||||
label
|
||||
)}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue