Skip to content

Commit

Permalink
Docs - make some groups (i.e. Incubator) not clickable (not links) si…
Browse files Browse the repository at this point in the history
…nce they have no docs (#1064)
  • Loading branch information
M-i-k-e-l authored Dec 15, 2020
1 parent f6a2004 commit c2a7654
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions uilib-docs/src/components/navbar/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Link from 'gatsby-link';
import _ from 'lodash';
import classnames from 'classnames';

const undocumentedGroups = ['Incubator'];

export default ({id, link, components, currentPage}) => {
const hasChildren = _.size(components) > 1;

Expand All @@ -11,11 +13,13 @@ export default ({id, link, components, currentPage}) => {
} else {
return (
<li key={id}>
<Link key={id} to={`/docs/${id}/`}>
<span class={classnames('entry', {selected: id === currentPage})}>
{id}
</span>
</Link>
{undocumentedGroups.includes(id) ? (
<span class={classnames('entry', {selected: id === currentPage})}>{id}</span>
) : (
<Link key={id} to={`/docs/${id}/`}>
<span class={classnames('entry', {selected: id === currentPage})}>{id}</span>
</Link>
)}

<ul class="nested">
{_.map(_.filter(components, c => c.node.displayName !== id), c => {
Expand Down

0 comments on commit c2a7654

Please sign in to comment.