mirror of
https://github.com/supabase/supabase.git
synced 2026-07-02 18:34:44 +08:00
* Update studio testing setup files Improves API mocking type safety and polyfills browser APIs necessary to run tests with framer-motion components * fix missing listen call for msw, resolve test type error * fix imports * Update studio testing setup files Improves API mocking type safety and polyfills browser APIs necessary to run tests with framer-motion components * fix missing listen call for msw, resolve test type error * fix imports * Move non-layout Storage related components to `components/interfaces` * Fix paths --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
23 lines
616 B
TypeScript
23 lines
616 B
TypeScript
import { useParams } from 'common'
|
|
import { COMMAND_MENU_SECTIONS } from 'components/interfaces/App/CommandMenu/CommandMenu.utils'
|
|
import type { CommandOptions } from 'ui-patterns/CommandMenu'
|
|
import { useRegisterCommands } from 'ui-patterns/CommandMenu'
|
|
|
|
export function useStorageGotoCommands(options?: CommandOptions) {
|
|
let { ref } = useParams()
|
|
ref ||= '_'
|
|
|
|
useRegisterCommands(
|
|
COMMAND_MENU_SECTIONS.NAVIGATE,
|
|
[
|
|
{
|
|
id: 'nav-storage',
|
|
name: 'Storage',
|
|
route: `/project/${ref}/storage`,
|
|
defaultHidden: true,
|
|
},
|
|
],
|
|
{ ...options, deps: [ref] }
|
|
)
|
|
}
|