mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 22:29:11 +03:00
19 lines
549 B
TypeScript
19 lines
549 B
TypeScript
import { usePathname } from 'next/navigation'
|
|
|
|
import { useIsNewLayoutEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
|
|
|
|
export function useHideSidebar() {
|
|
const newLayoutPreview = useIsNewLayoutEnabled()
|
|
const pathname = usePathname() ?? ''
|
|
|
|
const shouldHide =
|
|
pathname.startsWith('/account') ||
|
|
pathname.startsWith('/new') ||
|
|
pathname === '/support/new' ||
|
|
pathname === '/organizations' ||
|
|
pathname === '/sign-in' ||
|
|
(pathname === '/projects' && newLayoutPreview)
|
|
|
|
return shouldHide
|
|
}
|