UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

14 lines (13 loc) 805 B
import { jsx as _jsx } from "react/jsx-runtime"; import { requireMetaURL } from "../misc/MetaContext.js"; import { getClass } from "../util/css.js"; import CENTERED_LAYOUT_CSS from "./CenteredLayout.module.css"; import { LAYOUT_CLASS } from "./Layout.js"; /** * Layout that puts the content in the center of the screen with no header/footer and a narrow max-width. * - Used for e.g. login/register/error/form pages where the content is the only focus. */ export function CenteredLayout({ children, fullWidth = false }) { const { path } = requireMetaURL(); return (_jsx("main", { className: getClass(CENTERED_LAYOUT_CSS.main, LAYOUT_CLASS), children: _jsx("div", { className: CENTERED_LAYOUT_CSS.mainInner, style: fullWidth ? { maxWidth: "none" } : undefined, children: children }) }, path)); }