File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,20 @@ import usePage from '../hooks/use-page'
6
6
7
7
const TableOfContentsItems = ( { items, depth} ) => (
8
8
< >
9
- { items . map ( item => (
9
+ { items . map ( ( item , index ) => (
10
10
< React . Fragment key = { item . title } >
11
11
< NavList . Item
12
12
href = { item . url }
13
- sx = { { pl : depth > 1 ? 4 : 2 } }
14
- aria-label = { ` ${ item . title } ${ depth > 1 ? ` in ${ item . title } ` : '' } 10 of 200` }
13
+ aria-label = { ` ${ item . title } , ${ index + 1 } of ${ items . length } ` }
14
+ aria-labelledby = { null }
15
15
>
16
16
{ item . title }
17
+ { item . items ? (
18
+ < NavList . SubNav >
19
+ < TableOfContentsItems items = { item . items } depth = { depth + 1 } />
20
+ </ NavList . SubNav >
21
+ ) : null }
17
22
</ NavList . Item >
18
- { item . items ? < TableOfContentsItems items = { item . items } depth = { depth + 1 } /> : null }
19
23
</ React . Fragment >
20
24
) ) }
21
25
</ >
You can’t perform that action at this time.
0 commit comments