Skip to content

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

Move home sidebar icons to own component

Terry Suttond73dabe08235
diff --git a/apps/docs/components/Navigation/Navigation.types.ts b/apps/docs/components/Navigation/Navigation.types.ts
index 76afaa7b1c6..a644cc7c70d 100644
--- a/apps/docs/components/Navigation/Navigation.types.ts
+++ b/apps/docs/components/Navigation/Navigation.types.ts
@@ -22,3 +22,14 @@ export interface References {
currentVersion?: string
}
}
+
+type MenuItem = {
+ label: string
+ icon?: string
+ href?: string
+ level?: string
+ hasLightIcon?: boolean
+ community?: boolean
+}
+
+export type HomepageMenuItems = MenuItem[][]
diff --git a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx
index db93e1616a2..5298b6a31a8 100644
--- a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx
@@ -5,145 +5,10 @@ import { useRouter } from 'next/router'
import { Fragment } from 'react'
import { Badge } from '~/../../packages/ui'
-const home = [
- [
- {
- label: 'Home',
- icon: '/img/icons/menu/home',
- href: '/',
- level: 'home',
- },
- {
- label: 'Getting Started',
- icon: '/img/icons/menu/getting-started',
- href: '/guides/getting-started',
- level: 'gettingstarted',
- },
- ],
- [
- {
- label: 'Database',
- icon: '/img/icons/menu/database',
- href: '/guides/database',
- level: 'database',
- },
- {
- label: 'Serverless APIs',
- icon: '/img/icons/menu/reference',
- href: '/guides/api',
- level: 'api',
- },
- {
- label: 'Auth',
- icon: '/img/icons/menu/auth',
- href: '/guides/auth',
- level: 'auth',
- },
- {
- label: 'Edge Functions',
- icon: '/img/icons/menu/functions',
- href: '/guides/functions',
- level: 'functions',
- },
- {
- label: 'Realtime',
- icon: '/img/icons/menu/realtime',
- href: '/guides/realtime',
- level: 'realtime',
- },
- {
- label: 'Storage',
- icon: '/img/icons/menu/storage',
- href: '/guides/storage',
- level: 'storage',
- },
- ],
- [
- {
- label: 'Platform',
- icon: '/img/icons/menu/platform',
- href: '/guides/platform',
- level: 'platform',
- },
- {
- label: 'Resources',
- icon: '/img/icons/menu/platform',
- href: '/guides/resources',
- level: 'resources',
- },
- {
- label: 'Self-Hosting',
- icon: '/img/icons/menu/platform',
- href: '/guides/self-hosting',
- level: 'self_hosting',
- },
- {
- label: 'Integrations',
- icon: '/img/icons/menu/integrations',
- hasLightIcon: true,
- href: '/guides/integrations',
- level: 'integrations',
- },
- ],
- [
- {
- label: 'Client Library Reference',
- },
- {
- label: 'JavaScript',
- icon: '/img/icons/menu/reference-javascript',
- href: '/reference/javascript/introduction',
- level: 'reference_javascript',
- },
- {
- label: 'Flutter',
- icon: '/img/icons/menu/reference-dart',
- href: '/reference/dart/introduction',
- level: 'reference_dart',
- },
- {
- label: 'Python',
- icon: '/img/icons/menu/reference-python',
- href: '/reference/python/introduction',
- level: 'reference_python',
- community: true,
- },
- {
- label: 'C#',
- icon: '/img/icons/menu/reference-csharp',
- href: '/reference/csharp/introduction',
- level: 'reference_csharp',
- community: true,
- },
- {
- label: 'Swift',
- icon: '/img/icons/menu/reference-swift',
- href: '/reference/swift/introduction',
- level: 'reference_swift',
- community: true,
- },
- {
- label: 'Tools',
- },
- {
- label: 'Management API',
- icon: '/img/icons/menu/reference-api',
- href: '/reference/api/introduction',
- level: 'reference_javascript',
- },
- {
- label: 'Supabase CLI',
- icon: '/img/icons/menu/reference-cli',
- href: '/guides/cli',
- level: 'reference_javascript',
- },
- ],
-]
+import { HOMEPAGE_MENU_ITEMS } from './NavigationMenu.constants'
+import HomeMenuIconPicker from './HomeMenuIconPicker'
const NavigationMenuHome = ({ active }) => {
- const router = useRouter()
- const { isDarkMode } = useTheme()
-
return (
<div
className={[
@@ -152,7 +17,7 @@ const NavigationMenuHome = ({ active }) => {
].join(' ')}
>
<ul className="relative w-full flex flex-col gap-4">
- {home.map((section, sectionIndex) => {
+ {HOMEPAGE_MENU_ITEMS.map((section, sectionIndex) => {
return (
<Fragment key={`section-container-${sectionIndex}-border`}>
{sectionIndex !== 0 && (
@@ -183,15 +48,7 @@ const NavigationMenuHome = ({ active }) => {
'text-base transition-all duration-150 text-scale-1200 hover:text-brand-900 hover:cursor-pointer ',
].join(' ')}
>
- <Image
- alt={link.label}
- src={`${router.basePath}${
- isDarkMode ? link.icon : `${link.icon}-light`
- }${!link.icon.includes('png') ? '.svg' : ''}`}
- width={17}
- height={17}
- className="w-4 h-4 group-hover:scale-110 ease-out transition-all"
- />
+ {link?.icon && <HomeMenuIconPicker icon={link.icon} />}
{link.label}
{link.community && <Badge size="small">Community</Badge>}
</li>
diff --git a/apps/docs/components/Navigation/NavigationMenu/HomeMenuIconPicker.tsx b/apps/docs/components/Navigation/NavigationMenu/HomeMenuIconPicker.tsx
new file mode 100644
index 00000000000..2d6384c8540
--- /dev/null
+++ b/apps/docs/components/Navigation/NavigationMenu/HomeMenuIconPicker.tsx
@@ -0,0 +1,75 @@
+import React from 'react'
+import {
+ IconMenuApi,
+ IconMenuAuth,
+ IconMenuCli,
+ IconMenuCsharp,
+ IconMenuDatabase,
+ IconMenuEdgeFunctions,
+ IconMenuFlutter,
+ IconMenuGettingStarted,
+ IconMenuHome,
+ IconMenuIntegrations,
+ IconMenuJavascript,
+ IconMenuPlatform,
+ IconMenuPython,
+ IconMenuRealtime,
+ IconMenuResources,
+ IconMenuSelfHosting,
+ IconMenuServerlessApis,
+ IconMenuStorage,
+ IconMenuSwift,
+} from './HomeMenuIcons'
+
+function getMenuIcon(menuKey: string) {
+ switch (menuKey) {
+ case 'home':
+ return <IconMenuHome />
+ case 'getting-started':
+ return <IconMenuGettingStarted />
+ case 'database':
+ return <IconMenuDatabase />
+ case 'serverless-apis':
+ return <IconMenuServerlessApis />
+ case 'auth':
+ return <IconMenuAuth />
+ case 'edge-functions':
+ return <IconMenuEdgeFunctions />
+ case 'realtime':
+ return <IconMenuRealtime />
+ case 'storage':
+ return <IconMenuStorage />
+ case 'platform':
+ return <IconMenuPlatform />
+ case 'resources':
+ return <IconMenuResources />
+ case 'self-hosting':
+ return <IconMenuSelfHosting />
+ case 'integrations':
+ return <IconMenuIntegrations />
+ case 'javascript':
+ return <IconMenuJavascript />
+ case 'dart':
+ return <IconMenuFlutter />
+ case 'python':
+ return <IconMenuPython />
+ case 'csharp':
+ return <IconMenuCsharp />
+ case 'swift':
+ return <IconMenuSwift />
+ case 'api':
+ return <IconMenuApi />
+ case 'cli':
+ return <IconMenuCli />
+ default:
+ return <IconMenuPlatform />
+ }
+}
+
+type HomeMenuIconPickerProps = {
+ icon: string
+}
+
+export default function HomeMenuIconPicker({ icon }: HomeMenuIconPickerProps) {
+ return getMenuIcon(icon)
+}
diff --git a/apps/docs/components/Navigation/NavigationMenu/HomeMenuIcons.tsx b/apps/docs/components/Navigation/NavigationMenu/HomeMenuIcons.tsx
new file mode 100644
index 00000000000..e88195dd029
--- /dev/null
+++ b/apps/docs/components/Navigation/NavigationMenu/HomeMenuIcons.tsx
@@ -0,0 +1,258 @@
+export function IconMenuHome() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M5.889 13.83V8h4.222v5.83M3 5.494v8.338h10V5.54L7.994 2.02 3 5.493Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuApi() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M2.923 10.927A5.833 5.833 0 0 1 2.14 8m2.877-5.046A5.833 5.833 0 0 1 8 2.14m5.13 3.025c.465.84.73 1.807.73 2.835m-2.883 5.049A5.832 5.832 0 0 1 8 13.859m6.172-10.027a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM5.81 12.148a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm8.362 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM5.81 3.832a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuAuth() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M3.494 9.975h5m-5 0v2h5v-2m-5 0v-2h5v2M10 5V3a2 2 0 1 0-4 0v2m6.473 0v9h-9V5h9Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuCli() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="m5.266 5.552 2.4 2.401-2.4 2.402M8 10.149h3M2 2h12v12H2V2Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuCsharp() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="m2.242 11.3.004-.003a1.191 1.191 0 0 1-.134-.57V5.27c0-.442.185-.784.57-1.005.444-.259 1.393-.804 2.33-1.343 1.019-.587 2.024-1.165 2.35-1.356.42-.247.826-.254 1.25-.01l2.37 1.364 2.336 1.345c.189.109.33.247.425.414.098.167.145.366.145.587V10.73c-.001.216-.048.407-.138.573a1.089 1.089 0 0 1-.432.428l-1.786 1.028c-.973.56-1.947 1.12-2.92 1.682-.388.228-.767.236-1.155.042a1.65 1.65 0 0 1-.103-.056c-.382-.227-1.702-.986-2.881-1.664-.747-.429-1.437-.826-1.799-1.036a1.137 1.137 0 0 1-.432-.428Zm7.452-2.351a1.95 1.95 0 0 1-1.698.994 1.94 1.94 0 0 1-1.69-.983A1.946 1.946 0 0 1 9.68 7.02l1.7-.98a3.91 3.91 0 1 0-3.385 5.866 3.913 3.913 0 0 0 3.4-1.974l-1.701-.983Zm2.151-1.88h-.388v.316h-.312v.388h.312v.468h-.312v.388h.312v.316h.388v-.316h.472v.316h.388v-.316h.316v-.388h-.316v-.468h.316v-.388h-.316V7.07h-.388v.316h-.472V7.07Zm0 1.172v-.468h.472v.468h-.472Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuDatabase() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M3.502 6h8.996v4H3.502V6ZM3 10.002h10v4H3v-4ZM3 2h10v4H3V2Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuServerlessApis() {
+ return (
+ <svg width="14" height="14" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M1.923 9.927A5.833 5.833 0 0 1 1.14 7m2.877-5.046A5.833 5.833 0 0 1 7 1.14m5.13 3.025c.465.84.73 1.807.73 2.835m-2.883 5.049A5.832 5.832 0 0 1 7 12.859m6.172-10.027a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM4.81 11.148a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm8.362 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM4.81 2.832a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuEdgeFunctions() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M1.857 11.36a7 7 0 0 1 9.41-9.551M4.774 14.212a7 7 0 0 0 9.41-9.497m-8.812 7.845a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm9.296-9.13a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM12.5 8a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuExtensions() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M11.418 2.098v5m-2.5-2.5h5m-11.836-2.5h5v5h-5v-5Zm5.185 9.145a2.685 2.685 0 1 1-5.37 0 2.685 2.685 0 0 1 5.37 0Zm1.651-2.396h5v5h-5v-5Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuFlutter() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="m11.857 2-3.718.004L2.143 8l1.85 1.852 1.626-1.617L11.857 2ZM8.245 7.531c-.052-.002-.107-.005-.14.04l-3.198 3.197 1.836 1.825-.002.002 1.315 1.316a.549.549 0 0 1 .026.025c.035.036.074.074.13.062.607-.002 1.214-.002 1.821-.001l1.822-.001-3.232-3.235 3.23-3.23H8.31a.39.39 0 0 1-.064 0Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuGettingStarted() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="m13.429 8-4.681 2.702-4.681 2.703V2.594l4.68 2.703 4.682 2.702Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuIntegrations() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M11.83 1.453v5.619m-2.809-2.81h5.62M1.338 1.454h5.62v5.619h-5.62V1.453Zm5.827 10.278a3.017 3.017 0 1 1-6.035 0 3.017 3.017 0 0 1 6.035 0ZM9.02 9.038h5.62v5.619H9.02V9.038Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuJavascript() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M2 2h12v12H2V2Zm9.173 10.06c-.556 0-.87-.29-1.112-.685l-.916.533c.33.654 1.007 1.153 2.054 1.153 1.071 0 1.869-.556 1.869-1.572 0-.941-.541-1.36-1.5-1.771l-.281-.12c-.484-.21-.693-.347-.693-.686 0-.273.209-.483.54-.483.323 0 .532.137.725.483l.878-.563c-.371-.654-.887-.903-1.604-.903-1.007 0-1.651.644-1.651 1.49 0 .917.54 1.352 1.354 1.698l.282.121c.514.225.821.362.821.749 0 .322-.299.556-.766.556Zm-4.37-.007c-.387 0-.548-.266-.726-.58l-.917.556c.265.562.788 1.03 1.691 1.03 1 0 1.684-.532 1.684-1.7V7.51H7.407v3.834c0 .564-.233.709-.604.709Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
+export function IconMenuPlatform() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M11.556 5.554 13.77 7.14l-5.772 4.04-5.737-4.04 2.199-1.587M3.313 7.888.813 9.72l6.996 4.926 7.039-4.926-2.33-1.682M3.285 4.74 8 8.061l4.742-3.32L8 1.338 3.286 4.74Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuPython() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M6.424 1.627A9.05 9.05 0 0 1 7.923 1.5a9.885 9.885 0 0 1 1.633.127c.851.14 1.568.771 1.568 1.612v2.953a1.57 1.57 0 0 1-1.568 1.576H6.424c-1.063 0-1.959.903-1.959 1.927v1.416H3.387c-.911 0-1.443-.654-1.666-1.572-.3-1.233-.288-1.97 0-3.152.25-1.03 1.047-1.572 1.959-1.572h4.312V4.42H4.856V3.239c0-.895.241-1.38 1.568-1.612Zm.391 1.417a.592.592 0 0 0-.588-.593.59.59 0 0 0 0 1.182.59.59 0 0 0 .588-.59Zm4.7 3.148V4.815h1.177c.912 0 1.342.675 1.568 1.572.313 1.246.327 2.18 0 3.152-.317.944-.657 1.572-1.568 1.572h-4.7v.394h3.132v1.182c0 .896-.778 1.35-1.568 1.577-1.187.34-2.14.288-3.132 0-.829-.242-1.568-.736-1.568-1.576V9.733c0-.85.71-1.576 1.568-1.576h3.132c1.044 0 1.96-.898 1.96-1.966Zm-1.173 6.69a.589.589 0 1 0-1.177 0c0 .328.265.594.589.594a.59.59 0 0 0 .588-.593Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuRealtime() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M5.362.984v2.35m-1.866.144L1.365 1.282m2.052 3.92H1.052m8.023 9.653L4.557 4.523 15 9.115l-4.748 1.182-1.177 4.558Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuResources() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M13 12V5l-.009-3H3v10.5m0 0A1.5 1.5 0 0 0 4.5 14H13v-1.65L12.991 11H4.5A1.5 1.5 0 0 0 3 12.5ZM5.005 2v4l1.5-1.695L8.005 6V2h-3Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuSelfHosting() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M13.041 14.37v-2.285a3.245 3.245 0 0 0-3.244-3.244M7.317 10H3v4h3.552v-1.916a3.257 3.257 0 0 1 3.245-3.244m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM8 6H3V2h10v4h-1.43M3.502 6v4"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuStorage() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M13 7.616V5.6l-3.618-3.6H3v4.03m9.964-.447L9.38 2v3.584h3.584ZM1.974 6v8h12V7.509h-7.59l-1.533-1.51H1.974Z"
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="bevel"
+ />
+ </svg>
+ )
+}
+
+export function IconMenuSwift() {
+ return (
+ <svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M14.364 4.774c.004.128.005.256.006.384l.001.439v5.245c-.002.128-.003.256-.007.384-.007.28-.024.561-.073.837-.05.28-.133.541-.263.796a2.673 2.673 0 0 1-1.17 1.17c-.254.13-.514.211-.795.262-.276.05-.558.066-.837.073-.128.004-.256.005-.384.006l-.408.001H5.565l-.407-.001c-.128 0-.256-.002-.384-.006a5.571 5.571 0 0 1-.837-.073c-.28-.05-.541-.133-.796-.262a2.674 2.674 0 0 1-1.17-1.17 2.824 2.824 0 0 1-.262-.796 5.582 5.582 0 0 1-.073-.837 18.375 18.375 0 0 1-.006-.384l-.001-.404V5.158c.002-.128.003-.256.007-.384.007-.28.024-.561.073-.837.05-.28.133-.541.262-.796a2.673 2.673 0 0 1 1.362-1.258c.194-.08.393-.136.604-.174.207-.037.417-.056.627-.066.07-.003.14-.006.21-.007.128-.004.256-.005.384-.006l.457-.001H10.842l.384.006c.28.008.561.024.837.074.28.05.541.133.796.262a2.671 2.671 0 0 1 1.17 1.17c.13.255.212.515.262.796.05.276.066.558.073.837Zm-2.64 4.72h.002c1.094 1.347.797 2.791.656 2.519-.572-1.114-1.638-.83-2.178-.55-.044.028-.09.053-.136.078l-.008.004a.306.306 0 0 0-.01.006l.002-.002c-1.124.597-2.632.642-4.149-.01A6.673 6.673 0 0 1 2.908 8.97c.345.255.718.48 1.114.665 1.603.75 3.213.697 4.352 0C6.753 8.386 5.4 6.762 4.361 5.446a5.644 5.644 0 0 1-.534-.736C5.07 5.85 7.033 7.277 7.737 7.672c-1.494-1.58-2.812-3.525-2.75-3.462 2.355 2.372 4.527 3.714 4.527 3.714.082.045.143.081.192.113.044-.114.084-.232.118-.355.376-1.374-.047-2.946-1.004-4.243 2.184 1.311 3.474 3.802 2.946 5.91a75.282 75.282 0 0 0-.041.145Z"
+ fill="currentColor"
+ />
+ </svg>
+ )
+}
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index 78292feff7e..c91b7f4fcd8 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -1,4 +1,139 @@
-import { References } from '../Navigation.types'
+import { References, HomepageMenuItems } from '../Navigation.types'
+
+export const HOMEPAGE_MENU_ITEMS: HomepageMenuItems = [
+ [
+ {
+ label: 'Home',
+ icon: 'home',
+ href: '/',
+ level: 'home',
+ },
+ {
+ label: 'Getting Started',
+ icon: 'getting-started',
+ href: '/guides/getting-started',
+ level: 'gettingstarted',
+ },
+ ],
+ [
+ {
+ label: 'Database',
+ icon: 'database',
+ href: '/guides/database',
+ level: 'database',
+ },
+ {
+ label: 'Serverless APIs',
+ icon: 'serverless-apis',
+ href: '/guides/api',
+ level: 'api',
+ },
+ {
+ label: 'Auth',
+ icon: 'auth',
+ href: '/guides/auth',
+ level: 'auth',
+ },
+ {
+ label: 'Edge Functions',
+ icon: 'edge-functions',
+ href: '/guides/functions',
+ level: 'functions',
+ },
+ {
+ label: 'Realtime',
+ icon: 'realtime',
+ href: '/guides/realtime',
+ level: 'realtime',
+ },
+ {
+ label: 'Storage',
+ icon: 'storage',
+ href: '/guides/storage',
+ level: 'storage',
+ },
+ ],
+ [
+ {
+ label: 'Platform',
+ icon: 'platform',
+ href: '/guides/platform',
+ level: 'platform',
+ },
+ {
+ label: 'Resources',
+ icon: 'resources',
+ href: '/guides/resources',
+ level: 'resources',
+ },
+ {
+ label: 'Self-Hosting',
+ icon: 'self-hosting',
+ href: '/guides/self-hosting',
+ level: 'self_hosting',
+ },
+ {
+ label: 'Integrations',
+ icon: 'integrations',
+ hasLightIcon: true,
+ href: '/guides/integrations',
+ level: 'integrations',
+ },
+ ],
+ [
+ {
+ label: 'Client Library Reference',
+ },
+ {
+ label: 'JavaScript',
+ icon: 'javascript',
+ href: '/reference/javascript/introduction',
+ level: 'reference_javascript',
+ },
+ {
+ label: 'Flutter',
+ icon: 'dart',
+ href: '/reference/dart/introduction',
+ level: 'reference_dart',
+ },
+ {
+ label: 'Python',
+ icon: 'python',
+ href: '/reference/python/introduction',
+ level: 'reference_python',
+ community: true,
+ },
+ {
+ label: 'C#',
+ icon: 'csharp',
+ href: '/reference/csharp/introduction',
+ level: 'reference_csharp',
+ community: true,
+ },
+ {
+ label: 'Swift',
+ icon: 'swift',
+ href: '/reference/swift/introduction',
+ level: 'reference_swift',
+ community: true,
+ },
+ {
+ label: 'Tools',
+ },
+ {
+ label: 'Management API',
+ icon: 'api',
+ href: '/reference/api/introduction',
+ level: 'reference_javascript',
+ },
+ {
+ label: 'Supabase CLI',
+ icon: 'cli',
+ href: '/guides/cli',
+ level: 'reference_javascript',
+ },
+ ],
+]
export const REFERENCES: References = {
javascript: {
@@ -503,7 +638,7 @@ export const database = {
}
export const api = {
- icon: 'reference',
+ icon: 'serverless-apis',
title: 'Serverless APIs',
url: '/guides/api',
items: [
@@ -541,7 +676,7 @@ export const api = {
}
export const functions = {
- icon: 'functions',
+ icon: 'edge-functions',
title: 'Edge Functions',
url: '/guides/functions',
items: [
@@ -828,7 +963,7 @@ export const resources = {
export const self_hosting = {
title: 'Self-Hosting',
- icon: 'resources',
+ icon: 'self-hosting',
url: '/guides/self-hosting',
items: [
{ name: 'Overview', url: '/guides/self-hosting' },
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx
index a5ddbec9512..e0f93adbc57 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideListItems.tsx
@@ -5,20 +5,7 @@ import { useRouter } from 'next/router'
import React, { useEffect, useRef } from 'react'
import { IconChevronLeft } from '~/../../packages/ui'
import * as Accordion from '@radix-ui/react-accordion'
-
-const HeaderImage = React.memo(function HeaderImage(props: any) {
- const router = useRouter()
- const { isDarkMode } = useTheme()
-
- return (
- <Image
- alt={props.icon}
- width={15}
- height={15}
- src={`${router.basePath}` + `/img/icons/menu/${props.icon}${isDarkMode ? '' : '-light'}.svg`}
- />
- )
-})
+import HomeMenuIconPicker from './HomeMenuIconPicker'
const HeaderLink = React.memo(function HeaderLink(props: {
title: string
@@ -157,6 +144,7 @@ const ContentLink = React.memo(function ContentLink(props: any) {
})
const Content = (props) => {
+ console.log(props)
const { menu, id } = props
return (
@@ -179,8 +167,9 @@ const Content = (props) => {
<Link href={menu.url ?? ''} passHref>
<a>
- <div className="flex items-center gap-3 my-3">
- <HeaderImage icon={menu.icon} />
+ <div className="flex items-center gap-3 my-3 text-brand-900">
+ {console.log(menu)}
+ <HomeMenuIconPicker icon={menu.icon} />
<HeaderLink title={menu.title} url={menu.url} id={id} />
</div>
</a>