chore: fix docs build

This commit is contained in:
mathuo 2024-04-27 13:37:55 +01:00
parent 9c091f5126
commit f6e816fa10
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
2 changed files with 6 additions and 18 deletions

View File

@ -3,7 +3,7 @@
"version": "1.13.0",
"private": true,
"scripts": {
"build": "npm run create-templates && docusaurus build",
"build": "npm run build-templates && docusaurus build",
"clear": "docusaurus clear",
"start": "concurrently \"docusaurus start\" \"npm run start-esm-server\"",
"start-esm-server": "node web-server/index.mjs",

View File

@ -5,15 +5,11 @@ import BrowserOnly from '@docusaurus/BrowserOnly';
const BASE_SANDBOX_URL =
'https://codesandbox.io/s/github/mathuo/dockview/tree/master/packages/docs';
export const _CodeRunner = (props: {
id: string;
framework: string;
height: number;
}) => {
useActiveFramework();
export const _CodeRunner = (props: { id: string; height: number }) => {
const [framework] = useActiveFramework();
const sandboxUrl = `${BASE_SANDBOX_URL}/templates/${props.id}/${props.framework}`;
const path = `/templates/${props.id}/${props.framework}/index.html`;
const sandboxUrl = `${BASE_SANDBOX_URL}/templates/${props.id}/${framework}`;
const path = `/templates/${props.id}/${framework}/index.html`;
return (
<div>
<iframe
@ -35,15 +31,7 @@ export const _CodeRunner = (props: {
};
export const CodeRunner = (props: { id: string; height: number }) => {
const [framework] = useActiveFramework();
return (
<BrowserOnly>
{() => (
<_CodeRunner {...props} framework={framework.toLowerCase()} />
)}
</BrowserOnly>
);
return <BrowserOnly>{() => <_CodeRunner {...props} />}</BrowserOnly>;
};
const CodeSandbox = (props: { url: string }) => {