Skip to content

Commit

Permalink
fix(v2): remove invalid label attribute of footer links (#1980)
Browse files Browse the repository at this point in the history
* fix(v2): remove invalid attributes of footer links

* Add rest props

* Fix override props
  • Loading branch information
lex111 authored and endiliey committed Nov 13, 2019
1 parent 137e548 commit 9cbb703
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/docusaurus-theme-classic/src/theme/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';

function FooterLink({item}) {
const toUrl = useBaseUrl(item.to);
function FooterLink({to, href, label, ...props}) {
const toUrl = useBaseUrl(to);
return (
<Link
className="footer__link-item"
{...item}
{...(item.href
{...(href
? {
target: '_blank',
rel: 'noopener noreferrer',
href: item.href,
href,
}
: {
to: toUrl,
})}>
{item.label}
})}
{...props}>
{label}
</Link>
);
}
Expand Down Expand Up @@ -77,7 +77,7 @@ function Footer() {
/>
) : (
<li key={item.href || item.to} className="footer__item">
<FooterLink item={item} />
<FooterLink {...item} />
</li>
),
)}
Expand Down

0 comments on commit 9cbb703

Please sign in to comment.