Skip to content

Commit

Permalink
docs(nxdev): enable link on non collapsible section title (#12469)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcabanes committed Oct 7, 2022
1 parent 7fabc85 commit 77f540b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nx-dev/ui-common/src/lib/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function SidebarSection({ section }: { section: MenuSection }): JSX.Element {
<ul>
<li className="mt-2">
{section.itemList
.filter((i) => !!i.itemList.length)
.filter((i) => !!i.itemList?.length)
.map((item, index) => (
<SidebarSectionItems key={item.id + '-' + index} item={item} />
))}
Expand Down Expand Up @@ -81,9 +81,14 @@ function SidebarSectionItems({ item }: { item: MenuItem }): JSX.Element {
)}
onClick={handleCollapseToggle}
>
{item.name}
{item.disableCollapsible ? null : (
<CollapsibleIcon isCollapsed={collapsed} />
{item.disableCollapsible ? (
<Link href={item.id as string} passHref>
<a className="hover:underline">{item.name}</a>
</Link>
) : (
<>
{item.name} <CollapsibleIcon isCollapsed={collapsed} />
</>
)}
</h5>
<ul className={cx('mb-6', collapsed ? 'hidden' : '')}>
Expand Down

1 comment on commit 77f540b

@vercel
Copy link

@vercel vercel bot commented on 77f540b Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.