Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: update sidebar ui

Isaiah Hamilton63c1ec649709
diff --git a/apps/temp-docs/components/nav/SideBar.tsx b/apps/temp-docs/components/nav/SideBar.tsx
index 227bec9256a..4a6622409ad 100644
--- a/apps/temp-docs/components/nav/SideBar.tsx
+++ b/apps/temp-docs/components/nav/SideBar.tsx
@@ -1,60 +1,55 @@
import { Menu } from '@supabase/ui'
import Link from 'next/link'
import { useRouter } from 'next/router'
-import styles from '../../styles/Home.module.css'
-import ThemeToggle from '../ThemeToggle'
const SideBar = ({ menuItems }: { menuItems: any }) => {
const { asPath } = useRouter()
return (
- <div
- className={`${styles.sidebar} dark:bg-scale-200 dark:border-scale-400 relative h-full border-r py-4`}
- >
+ <div className="dark:bg-scale-200 dark:border-scale-400 thin-scrollbar sticky top-0 flex h-screen w-[400px] overflow-y-scroll border-r py-4">
<Menu>
<div>
{Object.keys(menuItems).map((key) => {
return (
<div key={key} className="mb-4">
<Menu.Group title={key} />
- {menuItems[key].map((item: { link: string; text: string; sections: Array }) => (
- <span key={item.link}>
- {Array.isArray(item.sections) ? (
- <>
- <Menu.Group title={item.text} />
- {item.sections.map((section) => (
- <Link href={section.link} key={`${item.text}-${section.text}`}>
+ {menuItems[key].map(
+ (item: { link: string; text: string; sections: Array<any> }) => (
+ <span key={item.link}>
+ {Array.isArray(item.sections) ? (
+ <>
+ <Menu.Group title={item.text} />
+ {item.sections.map((section) => (
+ <Link href={section.link} key={`${item.text}-${section.text}`}>
+ <a>
+ <Menu.Item
+ active={asPath == section.link}
+ showActiveBar={asPath === section.link}
+ >
+ {section.text}
+ </Menu.Item>
+ </a>
+ </Link>
+ ))}
+ </>
+ ) : (
+ <Link href={item.link}>
+ <a>
<Menu.Item
- active={asPath == section.link}
- showActiveBar={asPath === section.link}
+ active={asPath === item.link}
+ showActiveBar={asPath === item.link}
>
- {section.text}
+ {item.text}
</Menu.Item>
- </Link>
- ))}
- </>
- ) : (
- <Link href={item.link} passHref>
- <a>
- <Menu.Item
- active={asPath === item.link}
- showActiveBar={asPath === item.link}
- >
- {item.text}
- </Menu.Item>
- </a>
- </Link>
- )}
- </span>
- ))}
+ </a>
+ </Link>
+ )}
+ </span>
+ )
+ )}
</div>
)
})}
</div>
- <div className="mt-16 w-full">
- <Menu.Item>
- <ThemeToggle />
- </Menu.Item>
- </div>
</Menu>
</div>
)
diff --git a/apps/temp-docs/styles/Home.module.css b/apps/temp-docs/styles/Home.module.css
index 3a4ada61b1c..6d7be21e752 100644
--- a/apps/temp-docs/styles/Home.module.css
+++ b/apps/temp-docs/styles/Home.module.css
@@ -124,18 +124,3 @@
flex-direction: column;
}
}
-
-.navbar {
- height: 60px;
-}
-.sidebar {
- width: 300px;
-}
-
-.navLinks li {
- margin-left: 2.5em;
-}
-.navRight > * {
- margin-left: 1em;
- margin-right: 1em;
-}