fix(v2): remove invalid label attribute of footer links (#1980)

* fix(v2): remove invalid attributes of footer links

* Add rest props

* Fix override props
This commit is contained in:
Alexey Pyltsyn 2019-11-13 13:42:46 +03:00 committed by Endi
parent 137e548aef
commit 9cbb7030fa

View file

@ -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>
);
}
@ -77,7 +77,7 @@ function Footer() {
/>
) : (
<li key={item.href || item.to} className="footer__item">
<FooterLink item={item} />
<FooterLink {...item} />
</li>
),
)}