Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun committed Mar 31, 2020
1 parent c2297ab commit 205fdfd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function NavLink({activeBasePath, to, href, label, position, ...props}) {

return (
<Link
className="navbar__item navbar__link"
{...(href
? {
target: '_blank',
Expand All @@ -51,7 +50,7 @@ function NavLink({activeBasePath, to, href, label, position, ...props}) {

function NavItem({items, position, ...props}) {
if (!items) {
return <NavLink {...props} />;
return <NavLink className="navbar__item navbar__link" {...props} />;
}

return (
Expand All @@ -60,10 +59,16 @@ function NavItem({items, position, ...props}) {
'dropdown--left': position === 'left',
'dropdown--right': position === 'right',
})}>
<NavLink {...props}>{props.label}</NavLink>
<NavLink className="navbar__item navbar__link" {...props}>
{props.label}
</NavLink>
<ul className="dropdown__menu">
{items.map((linkItemInner, i) => (
<NavLink {...linkItemInner} key={i} />
<NavLink
className="navbar__item navbar__link"
{...linkItemInner}
key={i}
/>
))}
</ul>
</div>
Expand All @@ -81,7 +86,7 @@ function MobileNavItem({items, ...props}) {

return (
<li className="menu__list-item">
<NavLink class="menu__link menu__link--sublist" {...props}>
<NavLink className="menu__link menu__link--sublist" {...props}>
{props.label}
</NavLink>
<ul className="menu__list">
Expand Down Expand Up @@ -179,7 +184,7 @@ function Navbar() {
)}
</Link>
{links
.filter(linkItem => linkItem.position !== 'right')
.filter(linkItem => linkItem.position === 'left')
.map((linkItem, i) => (
<NavItem {...linkItem} key={i} />
))}
Expand Down

0 comments on commit 205fdfd

Please sign in to comment.