webapp/src/components/Views/StaticPage.tsx

35 lines
939 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) => {
2024-06-24 17:50:27 +00:00
let articleBodyElement: HTMLElement | null = null
2023-11-15 21:51:32 +00:00
return (
<PageLayout title={props.title}>
<article
class="wide-container container--static-page"
id="articleBody"
2024-06-24 17:50:27 +00:00
ref={(el) => (articleBodyElement = 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"
2024-06-24 17:50:27 +00:00
body={(articleBodyElement as unknown as HTMLElement)?.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>
)
}