Files
supabase/apps/studio/hooks/misc/useShowLayoutHeader.ts
T
Joshen Lim fd10704cc1 Make feature preview available + Fix up Connect UI for local self-host (#35060)
* Make feature preview available for local self-host

* Fix up Connect UI for local / self-host

* Fix

* Fix

* Fix
2025-04-16 19:35:09 +08:00

20 lines
559 B
TypeScript

import { useParams } from 'common'
import { useIsNewLayoutEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { useRouter } from 'next/router'
export function useShowLayoutHeader() {
const newLayoutPreview = useIsNewLayoutEnabled()
const { ref } = useParams()
const router = useRouter()
const pathname = router.pathname ?? ''
const shouldShow =
pathname.startsWith('/new') ||
pathname === '/organizations' ||
pathname === '/sign-in' ||
newLayoutPreview ||
Boolean(ref)
return shouldShow
}