@@ -4,12 +4,8 @@ import {serverContext} from 'sentry-docs/serverContext';
44import { sortPages } from 'sentry-docs/utils' ;
55import { getUnversionedPath , VERSION_INDICATOR } from 'sentry-docs/versioning' ;
66
7- import styles from './style.module.scss' ;
8-
9- import { SidebarLink } from '../sidebarLink' ;
10- import { SmartLink } from '../smartLink' ;
11-
12- import { NavChevron } from './navChevron' ;
7+ import { CollapsibleSidebarLink } from './collapsibleSidebarLink' ;
8+ import { SidebarLink } from './sidebarLink' ;
139
1410type Node = {
1511 [ key : string ] : any ;
@@ -83,15 +79,15 @@ export const renderChildren = (
8379 return null ;
8480 }
8581 return (
86- < SidebarLink
82+ < CollapsibleSidebarLink
8783 to = { node . path }
8884 key = { node . path }
8985 title = { node . context . sidebar_title || node . context . title ! }
9086 collapsed = { depth >= showDepth }
9187 path = { path }
9288 >
9389 { renderChildren ( nodeChildren , exclude , path , showDepth , depth + 1 ) }
94- </ SidebarLink >
90+ </ CollapsibleSidebarLink >
9591 ) ;
9692 } ) ;
9793} ;
@@ -142,6 +138,9 @@ export function DynamicNav({
142138 if ( ! title && entity . node ) {
143139 title = entity . node . context . sidebar_title || entity . node . context . title || '' ;
144140 }
141+ if ( ! title ) {
142+ return null ;
143+ }
145144 const parentNode = entity . children ?. find ( ( n : EntityTree ) => n . name === '' ) ;
146145
147146 if ( ! parentNode ) {
@@ -153,15 +152,14 @@ export function DynamicNav({
153152 const linkPath = `/${ path . join ( '/' ) } /` ;
154153
155154 const header = (
156- < SmartLink
157- to = { `/${ root } /` }
158- className = { `${ styles [ 'sidebar-title' ] } flex items-center ${ getUnversionedPath ( path , false ) === root ? 'active' : '' } justify-between` }
159- activeClassName = "active"
155+ < SidebarLink
156+ href = { `/${ root } /` }
157+ title = { title }
158+ collapsible = { collapsible }
159+ isActive = { getUnversionedPath ( path , false ) === root }
160+ topLevel
160161 data-sidebar-link
161- >
162- < strong > { title } </ strong >
163- { collapsible && < NavChevron direction = { isActive ? 'down' : 'right' } /> }
164- </ SmartLink >
162+ />
165163 ) ;
166164
167165 return (
0 commit comments