Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Apr 25, 2020
1 parent 8477e89 commit 5aabdef
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function NavLink({activeBasePath, to, href, label, position, ...props}) {
}

function NavItem({items, position, className, ...props}) {
const navLinkClassNames = (className) =>
classnames('navbar__item', 'navbar__link', className);
const navLinkClassNames = (extraClassName) =>
classnames('navbar__item', 'navbar__link', extraClassName);

if (!items) {
return <NavLink className={navLinkClassNames(className)} {...props} />;
Expand All @@ -67,22 +67,24 @@ function NavItem({items, position, className, ...props}) {
{props.label}
</NavLink>
<ul className="dropdown__menu">
{items.map(({className, ...linkItemInnerProps}, i) => (
<li key={i}>
<NavLink
className={navLinkClassNames(className)}
{...linkItemInnerProps}
/>
</li>
))}
{items.map(
({className: childItemClassName, ...linkItemInnerProps}, i) => (
<li key={i}>
<NavLink
className={navLinkClassNames(childItemClassName)}
{...linkItemInnerProps}
/>
</li>
),
)}
</ul>
</div>
);
}

function MobileNavItem({items, className, ...props}) {
const navLinkClassNames = (className, isSubList = false) =>
classnames('menu__link', className, {
const navLinkClassNames = (extraClassName, isSubList = false) =>
classnames('menu__link', extraClassName, {
'menu__link--sublist': isSubList,
});

Expand All @@ -100,15 +102,17 @@ function MobileNavItem({items, className, ...props}) {
{props.label}
</NavLink>
<ul className="menu__list">
{items.map(({className, ...linkItemInnerProps}, i) => (
<li className="menu__list-item" key={i}>
<NavLink
className={navLinkClassNames(className)}
{...linkItemInnerProps}
onClick={props.onClick}
/>
</li>
))}
{items.map(
({className: childItemClassName, ...linkItemInnerProps}, i) => (
<li className="menu__list-item" key={i}>
<NavLink
className={navLinkClassNames(childItemClassName)}
{...linkItemInnerProps}
onClick={props.onClick}
/>
</li>
),
)}
</ul>
</li>
);
Expand Down

0 comments on commit 5aabdef

Please sign in to comment.