Files
Joshen Lim b4023b6eb2 Chore/banner for ipv4 deprecation notice (#20334)
* Add LayoutWrapper component to DRY the layout height change when incident banner is toggled

* Add notice banner for pgbouncer and ipv4 deprecation
2024-01-11 16:20:38 +08:00

32 lines
954 B
TypeScript

import { useParams } from 'common'
import { useRouter } from 'next/router'
import { PropsWithChildren } from 'react'
import AppLayout from '../AppLayout/AppLayout'
import AccountSettingsMenu from './AccountSettingsMenu'
import OrganizationSettingsMenu from './OrganizationSettingsMenu'
const SettingsLayout = ({ children }: PropsWithChildren<{}>) => {
const router = useRouter()
const { ref, slug } = useParams()
return (
<AppLayout>
<div className="flex h-full">
{router.pathname !== '/projects' && (
<div className="h-full overflow-y-auto min-w-[280px] border-r px-8 py-8">
{slug === undefined && ref === undefined ? (
<AccountSettingsMenu />
) : (
<OrganizationSettingsMenu />
)}
</div>
)}
<div className="h-full overflow-y-auto flex-grow">{children}</div>
</div>
</AppLayout>
)
}
export default SettingsLayout