Files
supabase/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx
Etienne Stalmans 9f29d5c8df chore: new security page without flag (#36855)
* chore: new security page without flag

Remove feature flag for new security page

* chore: add additional docs

* chore: prettier

* chore: move mfa enforcement page

* fix: link fixes
2025-07-16 16:24:11 +02:00

70 lines
1.9 KiB
TypeScript

import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { useParams } from 'common'
import { useCurrentPath } from 'hooks/misc/useCurrentPath'
import { NavMenu, NavMenuItem } from 'ui'
import { ScaffoldContainerLegacy, ScaffoldTitle } from '../Scaffold'
function OrganizationSettingsLayout({ children }: PropsWithChildren) {
const { slug } = useParams()
// Get the path without any hash values
const fullCurrentPath = useCurrentPath()
const [currentPath] = fullCurrentPath.split('#')
// Hide these settings in the new layout on the following paths
const isHidden = (path: string) => {
return (
path === `/org/${slug}/team` ||
path === `/org/${slug}/integrations` ||
path === `/org/${slug}/usage` ||
path === `/org/${slug}/billing`
)
}
if (isHidden(currentPath)) {
return children
}
const navMenuItems = [
{
label: 'General',
href: `/org/${slug}/general`,
},
{
label: 'Security',
href: `/org/${slug}/security`,
},
{
label: 'OAuth Apps',
href: `/org/${slug}/apps`,
},
{
label: 'Audit Logs',
href: `/org/${slug}/audit`,
},
{
label: 'Legal Documents',
href: `/org/${slug}/documents`,
},
]
return (
<>
<ScaffoldContainerLegacy className="mb-0">
<ScaffoldTitle>Organization Settings</ScaffoldTitle>
<NavMenu className="overflow-x-auto" aria-label="Organization menu navigation">
{(navMenuItems.filter(Boolean) as { label: string; href: string }[]).map((item) => (
<NavMenuItem key={item.label} active={currentPath === item.href}>
<Link href={item.href}>{item.label}</Link>
</NavMenuItem>
))}
</NavMenu>
</ScaffoldContainerLegacy>
<main className="h-full w-full overflow-y-auto">{children}</main>
</>
)
}
export default OrganizationSettingsLayout