Skip to content

Commit 82e81b5

Browse files
authored
Wrap sidebar in a nav element (github#40171)
1 parent 2f49604 commit 82e81b5

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

components/sidebar/SidebarNav.tsx

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,36 @@ export const SidebarNav = ({ variant = 'full' }: Props) => {
2323
className={cx(variant === 'full' ? 'position-sticky d-none border-right d-xxl-block' : '')}
2424
style={{ width: 326, height: 'calc(100vh - 65px)', top: '65px' }}
2525
>
26-
{variant === 'full' && currentProduct && (
27-
<nav
28-
className={cx('d-none px-4 pb-3 border-bottom d-xxl-block')}
29-
aria-labelledby="allproducts-menu"
30-
>
31-
<AllProductsLink />
32-
{currentProduct && (
33-
<div className="mt-3" id="allproducts-menu" aria-label="all products menu">
34-
<Link
35-
data-testid="sidebar-product-xl"
36-
href={currentProduct.href}
37-
// Note the `_product-title` is used by the popover preview cards
38-
// when it needs this text for in-page links.
39-
className="d-block pl-1 mb-2 h3 color-fg-default no-underline _product-title"
40-
>
41-
{currentProduct.name}
42-
</Link>
43-
</div>
44-
)}
45-
{variant === 'full' && isRestPage && <ApiVersionPicker />}
46-
</nav>
47-
)}
48-
<div
49-
className={cx(
50-
variant === 'overlay' ? 'd-xxl-none' : 'border-right d-none d-xxl-block',
51-
'bg-primary overflow-y-auto flex-shrink-0',
26+
<nav aria-labelledby="allproducts-menu">
27+
{variant === 'full' && currentProduct && (
28+
<div className={cx('d-none px-4 pb-3 border-bottom d-xxl-block')}>
29+
<AllProductsLink />
30+
{currentProduct && (
31+
<div className="mt-3" id="allproducts-menu">
32+
<Link
33+
data-testid="sidebar-product-xl"
34+
href={currentProduct.href}
35+
// Note the `_product-title` is used by the popover preview cards
36+
// when it needs this text for in-page links.
37+
className="d-block pl-1 mb-2 h3 color-fg-default no-underline _product-title"
38+
>
39+
{currentProduct.name}
40+
</Link>
41+
</div>
42+
)}
43+
{variant === 'full' && isRestPage && <ApiVersionPicker />}
44+
</div>
5245
)}
53-
style={{ width: 326, height: 'calc(100vh - 175px)', paddingBottom: sidebarPaddingBottom }}
54-
>
55-
<nav aria-label="product menu">
46+
<div
47+
className={cx(
48+
variant === 'overlay' ? 'd-xxl-none' : 'border-right d-none d-xxl-block',
49+
'bg-primary overflow-y-auto flex-shrink-0',
50+
)}
51+
style={{ width: 326, height: 'calc(100vh - 175px)', paddingBottom: sidebarPaddingBottom }}
52+
>
5653
<SidebarProduct />
57-
</nav>
58-
</div>
54+
</div>
55+
</nav>
5956
</div>
6057
)
6158
}

0 commit comments

Comments
 (0)