Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nav level rule #10568

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions polaris.shopify.com/content/design/typography/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ keywords:
- font sizes
- fonts
icon: TypeMajor
hideChildren: true
---

# {frontmatter.title}
Expand Down
5 changes: 1 addition & 4 deletions polaris.shopify.com/src/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import {useRouter} from 'next/router';
import StatusBadge from '../StatusBadge';

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

if (!child.slug) return null;

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