Skip to content

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

Fix/cmd k menu items (#19850)

Terry Suttonf30c08a3fd1d
diff --git a/packages/ui/src/components/Command/CommandMenu.tsx b/packages/ui/src/components/Command/CommandMenu.tsx
index 875c1661065..624148fcf17 100644
--- a/packages/ui/src/components/Command/CommandMenu.tsx
+++ b/packages/ui/src/components/Command/CommandMenu.tsx
@@ -38,6 +38,7 @@ import CommandMenuShortcuts from './CommandMenuShortcuts'
import { BadgeExperimental } from './Command.Badges'
import { AiIconAnimation } from '@ui/layout/ai-icon-animation'
import ChildItem from './ChildItem'
+import { useParams } from 'common'
export const CHAT_ROUTES = [
COMMAND_ROUTES.AI, // this one is temporary
@@ -58,12 +59,9 @@ const iconPicker: { [key: string]: React.ReactNode } = {
products: <IconColumns />,
}
-interface CommandMenuProps {
- projectRef?: string
-}
-
-const CommandMenu = ({ projectRef }: CommandMenuProps) => {
+const CommandMenu = () => {
const router = useRouter()
+ const { ref: projectRef } = useParams()
const {
isOpen,
@@ -246,9 +244,7 @@ const CommandMenu = ({ projectRef }: CommandMenuProps) => {
{site === 'studio' && (
<CommandGroup heading="Navigate">
{sharedItems.tools.map((item) => {
- const itemUrl = (
- projectRef ? item.url.replace('_', projectRef) : item.url
- ).split('https://supabase.com/dashboard')[1]
+ const itemUrl = projectRef ? item.url.replace('_', projectRef) : item.url
return (
<CommandItem
diff --git a/packages/ui/src/components/Command/CommandMenuProvider.tsx b/packages/ui/src/components/Command/CommandMenuProvider.tsx
index 61e9f0f34e2..b15361aedae 100644
--- a/packages/ui/src/components/Command/CommandMenuProvider.tsx
+++ b/packages/ui/src/components/Command/CommandMenuProvider.tsx
@@ -119,7 +119,7 @@ const CommandMenuProvider = ({
}}
>
{children}
- <CommandMenu projectRef={projectRef} />
+ <CommandMenu />
</CommandMenuContext.Provider>
)
}