Skip to content

Commit

Permalink
chore: fix docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
mathuo committed Apr 27, 2024
1 parent 9c091f5 commit f6e816f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 5 additions & 17 deletions packages/docs/src/components/ui/codeRunner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }) => {
Expand Down

0 comments on commit f6e816f

Please sign in to comment.