Extract shared graph SPA
This commit is contained in:
parent
9d138616b1
commit
2c773a2a8c
13 changed files with 2556 additions and 16 deletions
26
quartz/components/GameCultGraphSpaShell.tsx
Normal file
26
quartz/components/GameCultGraphSpaShell.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { QuartzComponent, QuartzComponentConstructor } from "./types"
|
||||
|
||||
export type GameCultGraphSpaShellOptions = {
|
||||
stylesheetHref: string
|
||||
moduleSrc: string
|
||||
rootClassName?: string
|
||||
}
|
||||
|
||||
export default ((options?: Partial<GameCultGraphSpaShellOptions>) => {
|
||||
const shellOptions: GameCultGraphSpaShellOptions = {
|
||||
stylesheetHref: "/static/epiphany-graph/assets/viewer.css",
|
||||
moduleSrc: "/static/epiphany-graph/assets/viewer.js",
|
||||
rootClassName: "gamecult-epiphany-graph-root",
|
||||
...options,
|
||||
}
|
||||
|
||||
const GameCultGraphSpaShell: QuartzComponent = () => (
|
||||
<>
|
||||
<link rel="stylesheet" href={shellOptions.stylesheetHref} />
|
||||
<div class={shellOptions.rootClassName}></div>
|
||||
<script type="module" src={shellOptions.moduleSrc}></script>
|
||||
</>
|
||||
)
|
||||
|
||||
return GameCultGraphSpaShell
|
||||
}) satisfies QuartzComponentConstructor<Partial<GameCultGraphSpaShellOptions> | undefined>
|
||||
Loading…
Reference in a new issue