Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.0 KB
Raw Blame
import { useValues } from 'kea'
import { CSSProperties, ReactNode } from 'react'

import { themeLogic } from '../themeLogic'

/** Outer frame for the layouts without app chrome. */
export function SimpleLayoutFrame({
    nav,
    mainClassName,
    children,
}: {
    nav?: ReactNode
    mainClassName?: string
    children: ReactNode
}): JSX.Element {
    const { theme } = useValues(themeLogic)

    return (
        // eslint-disable-next-line react/forbid-dom-props
        <div
            className="Navigation3000 flex-col"
            style={
                {
                    ...theme?.mainStyle,
                    // MinimalNavigation sits above the scene, so the fixed settings nav must clear it.
                    ...(nav && {
                        '--settings-nav-top': 'calc(var(--minimal-navigation-height) + var(--scene-padding))',
                    }),
                } as CSSProperties
            }
        >
            {nav}
            <main className={mainClassName}>{children}</main>
        </div>
    )
}