Skip to content

Commit 9ff79bc

Browse files
committed
fix: update positioning of side nav in docs
1 parent e9d4bd9 commit 9ff79bc

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/app/_components/SidebarNav/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client';
22

3+
import { Fragment } from 'react';
34
import Link from 'next/link';
45
import { usePathname } from 'next/navigation';
56
import {
@@ -32,16 +33,16 @@ export default function SidebarNav({ activeTab, links }: SidebarNavProps) {
3233
return items.map((link) => {
3334
if (link.children) {
3435
return (
35-
<>
36+
<Fragment key={link.id}>
3637
<MenuLabel>{link.label}</MenuLabel>
3738
{renderMenuLinks(link.children)}
38-
</>
39+
</Fragment>
3940
);
4041
}
4142

4243
return (
4344
<MenuItem
44-
key={link.id}
45+
key={link.id ?? link.href}
4546
leftSection={link.icon}
4647
component={Link}
4748
href={link.href}
@@ -58,7 +59,7 @@ export default function SidebarNav({ activeTab, links }: SidebarNavProps) {
5859
return items.map((item) => {
5960
return (
6061
<NavLink
61-
key={item.id}
62+
key={item.id ?? item.href}
6263
href={item.href}
6364
label={item.label}
6465
component={Link}
@@ -83,7 +84,7 @@ export default function SidebarNav({ activeTab, links }: SidebarNavProps) {
8384
</Menu>
8485
</Box>
8586
<Box visibleFrom="md" w={{ base: '100%', md: '20%' }}>
86-
<Stack h="100%" gap={0}>
87+
<Stack h="100%" gap={0} align="flex-start">
8788
{renderNavItems(links)}
8889
</Stack>
8990
</Box>

src/app/docs/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function generateMetadata(
4343
export default async function MDXLayout({ children }: { children: React.ReactNode }) {
4444
return (
4545
<Screen title="Documentation" className="markdown-page">
46-
<Group w="100%" h="100%" gap={0}>
46+
<Group w="100%" h="100%" gap={0} align="flex-start">
4747
<SidebarNav links={DOCS_NAV_ITEMS} />
4848
<Stack h="100%" w="80%" className="markdown" gap={0}>
4949
{children}

0 commit comments

Comments
 (0)