mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 10:25:06 +03:00
33 lines
874 B
TypeScript
33 lines
874 B
TypeScript
import { PropsWithChildren } from 'react'
|
|
|
|
import AppHeader from './AppHeader'
|
|
import { useFlag } from 'hooks'
|
|
|
|
const AppLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
const navLayoutV2 = useFlag('navigationLayoutV2')
|
|
const ongoingIncident = useFlag('ongoingIncident')
|
|
|
|
const appHeaderHeight = navLayoutV2 ? 49 : 0
|
|
const incidentBannerHeight = 44
|
|
|
|
return (
|
|
<div>
|
|
{navLayoutV2 && <AppHeader />}
|
|
<div
|
|
style={{
|
|
height: ongoingIncident
|
|
? `calc(100vh - ${incidentBannerHeight}px - ${appHeaderHeight}px)`
|
|
: `calc(100vh - ${appHeaderHeight}px)`,
|
|
maxHeight: ongoingIncident
|
|
? `calc(100vh - ${incidentBannerHeight}px - ${appHeaderHeight}px)`
|
|
: `calc(100vh - ${appHeaderHeight}px)`,
|
|
}}
|
|
>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default AppLayout
|