Skip to content

Commit

Permalink
fix: add runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
v8tenko committed Feb 1, 2024
1 parent 48b9218 commit 0b50b57
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,28 @@ export type DocInnerProps<Data = DocLeadingPageData | DocPageData> = {

export type {DocLeadingPageData, DocPageData};

type RuntimeProps = {
theme: Theme;
};

function Runtime(props: RuntimeProps) {
const {theme} = props;

return (
<>
<OpenapiSandbox />
<LatexRuntime />
<MermaidRuntime
theme={theme === Theme.Dark ? 'dark' : 'neutral'}
zoom={{
showMenu: true,
bindKeys: true,
}}
/>
</>
);
}

function Page(props: DocInnerProps) {
const {data, ...pageProps} = props;

Expand Down Expand Up @@ -115,6 +137,7 @@ export function App(props: DocInnerProps): ReactElement {
return (
<div className="App">
<Page {...pageProps} {...settings} />
<Runtime theme={theme} />
</div>
);
}
Expand Down Expand Up @@ -160,15 +183,7 @@ export function App(props: DocInnerProps): ReactElement {
}
/>
</PageConstructorProvider>
<OpenapiSandbox />
<LatexRuntime />
<MermaidRuntime
theme={theme === Theme.Dark ? 'dark' : 'neutral'}
zoom={{
showMenu: true,
bindKeys: true,
}}
/>
<Runtime theme={theme} />
</div>
);
}

0 comments on commit 0b50b57

Please sign in to comment.