Skip to content

Commit 242f512

Browse files
authored
Remove nav level rule (Shopify#10568)
Remove the max level rule in the Frame nav and use the `hideChildren` boolean in frontmatter
1 parent 5c09e04 commit 242f512

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

polaris.shopify.com/content/design/typography/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ keywords:
66
- font sizes
77
- fonts
88
icon: TypeMajor
9+
hideChildren: true
910
---
1011

1112
# {frontmatter.title}

polaris.shopify.com/src/components/Frame/Frame.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import {useRouter} from 'next/router';
1414
import StatusBadge from '../StatusBadge';
1515

1616
const NAV_ID = 'nav';
17-
// Nav levels greater than this should be part of <Subnav />
18-
const MAX_NAV_LEVEL = 1;
1917
interface Props {
2018
darkMode: DarkMode;
2119
children: React.ReactNode;
@@ -216,8 +214,7 @@ function NavItem({
216214

217215
if (!child.slug) return null;
218216

219-
const isExpandable =
220-
child.children && !child.hideChildren && level < MAX_NAV_LEVEL;
217+
const isExpandable = child.children && !child.hideChildren;
221218
const id = (child.slug || key).replace(/\//g, '');
222219
const navAriaId = `nav-${id}`;
223220
const segments = asPath.slice(1).split('/');

0 commit comments

Comments
 (0)