diff options
Diffstat (limited to 'src/ui/base/SplitLayout.tsx')
| -rw-r--r-- | src/ui/base/SplitLayout.tsx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ui/base/SplitLayout.tsx b/src/ui/base/SplitLayout.tsx new file mode 100644 index 0000000..65dff2d --- /dev/null +++ b/src/ui/base/SplitLayout.tsx | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | import { SiteHeader } from "$/ui/components/SiteHeader.tsx"; | ||
| 2 | import { SplitView } from "$/ui/layouts/SplitView.tsx"; | ||
| 3 | import { SplitViewPanel } from "$/ui/layouts/SplitViewPanel.tsx"; | ||
| 4 | import { Heading } from "$/ui/objects/Heading.tsx"; | ||
| 5 | |||
| 6 | import type { Props as BaseLayoutProps } from "./BaseLayout.tsx"; | ||
| 7 | |||
| 8 | import { BaseLayout } from "./BaseLayout.tsx"; | ||
| 9 | |||
| 10 | export interface Props extends BaseLayoutProps { | ||
| 11 | "content"?: JSX.Element; | ||
| 12 | "header-end"?: JSX.Element; | ||
| 13 | } | ||
| 14 | |||
| 15 | export const SplitLayout = ({ | ||
| 16 | children, | ||
| 17 | page, | ||
| 18 | content, | ||
| 19 | "header-end": headerEnd, | ||
| 20 | ...props | ||
| 21 | }: Props) => ( | ||
| 22 | <BaseLayout page={page} {...props}> | ||
| 23 | <SiteHeader mode="compact" url={page.url} end={headerEnd}> | ||
| 24 | <div class="l-media__block l-media__block--main"> | ||
| 25 | <Heading class="u-mbs-0 u-elp">{page.data.title}</Heading> | ||
| 26 | </div> | ||
| 27 | </SiteHeader> | ||
| 28 | |||
| 29 | <SplitView as="main" class="l-container l-container--pad-i l-container--pad-b u-pbs-400"> | ||
| 30 | <SplitViewPanel sticky side="25" min="200"> | ||
| 31 | {children} | ||
| 32 | </SplitViewPanel> | ||
| 33 | |||
| 34 | <SplitViewPanel>{content}</SplitViewPanel> | ||
| 35 | </SplitView> | ||
| 36 | </BaseLayout> | ||
| 37 | ); | ||
