Skip to content

Commit

Permalink
chore(docs): update mobile navigation to include header
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Oct 8, 2023
1 parent 86f2c25 commit b7710cd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
10 changes: 8 additions & 2 deletions apps/docs/src/components/RootLayout/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ import { type ReactElement } from "react";
import { NavigationItemGroup } from "./NavigationItemGroup.jsx";
import { RenderNavigationItem } from "./RenderNavigationItem.jsx";

export function Navigation(): ReactElement {
export interface NavigationProps {
className?: string;
}

export function Navigation(props: NavigationProps): ReactElement {
const { className } = props;

return (
<NavigationItemGroup depth={0}>
<NavigationItemGroup depth={0} className={className}>
<RenderRecursively items={navItems} render={RenderNavigationItem} />
</NavigationItemGroup>
);
Expand Down
4 changes: 4 additions & 0 deletions apps/docs/src/components/RootLayout/RootLayout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
grid-template-columns: 1fr var(--toc-width);
}
}

.scrollable {
overflow: auto;
}
9 changes: 8 additions & 1 deletion apps/docs/src/components/RootLayout/RootLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { GithubLink } from "@/components/GithubLink.jsx";
import { WebsiteConfiguration } from "@/components/WebsiteConfiguration/WebsiteConfiguration.jsx";
import {
AppBar,
AppBarTitle,
Button,
LayoutAppBar,
LayoutNav,
Expand All @@ -20,6 +22,7 @@ import {
type RootLayoutTitleProps,
} from "./RootLayoutTitle.jsx";
import { Search } from "./Search.jsx";
import { VersionDropdown } from "./VersionDropdown.jsx";

export interface RootLayoutProps {
isMac: boolean;
Expand Down Expand Up @@ -62,7 +65,11 @@ export function RootLayout(props: RootLayoutProps): ReactElement {
</LayoutNav>
{temporary && (
<Sheet {...temporaryNavProps}>
<Navigation />
<AppBar theme="clear">
<AppBarTitle>react-md</AppBarTitle>
<VersionDropdown {...titleProps} />
</AppBar>
<Navigation className={styles.scrollable} />
</Sheet>
)}
<Main
Expand Down

0 comments on commit b7710cd

Please sign in to comment.