webapp/src/components/Views/StaticPage.tsx

35 lines
947 B
TypeScript
Raw Normal View History

import { JSX } from 'solid-js'
2023-11-15 21:51:32 +00:00
import { TableOfContents } from '../TableOfContents'
2024-02-04 11:25:21 +00:00
import { PageLayout } from '../_shared/PageLayout'
2023-11-15 21:51:32 +00:00
type Props = {
2023-11-15 21:51:32 +00:00
title: string
children: JSX.Element
}
export const StaticPage = (props: Props) => {
const articleBodyElement: { current: HTMLElement } = { current: null }
2023-11-15 21:51:32 +00:00
return (
<PageLayout title={props.title}>
<article
class="wide-container container--static-page"
id="articleBody"
ref={(el) => (articleBodyElement.current = el)}
>
2023-11-15 21:51:32 +00:00
<div class="row">
<div class="col-md-12 col-xl-14 offset-md-5 order-md-first">{props.children}</div>
2023-11-15 21:51:32 +00:00
<div class="col-md-6 col-lg-4 order-md-last">
2023-11-15 21:56:31 +00:00
<TableOfContents
variant="article"
parentSelector="#articleBody"
body={articleBodyElement.current.outerHTML}
2023-11-15 21:56:31 +00:00
/>
2023-11-15 21:51:32 +00:00
</div>
</div>
</article>
2023-11-15 21:51:32 +00:00
</PageLayout>
)
}