Skip to content

Commit

Permalink
[docs-infra] Fix Code Sandbox download issue (#39317)
Browse files Browse the repository at this point in the history
  • Loading branch information
ARJ2160 authored Oct 9, 2023
1 parent 8cfa1c8 commit 18d087f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/src/modules/sandbox/CodeSandbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('CodeSandbox', () => {
</body>
</html>`,
},
'Demo.js': {
'src/Demo.js': {
content: `import * as React from 'react';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
Expand All @@ -83,7 +83,7 @@ export default function BasicButtons() {
}
`,
},
'index.js': {
'src/index.js': {
content: `import * as React from 'react';
import * as ReactDOM from 'react-dom/client';
import { StyledEngineProvider } from '@mui/material/styles';
Expand Down Expand Up @@ -157,7 +157,7 @@ ReactDOM.createRoot(document.querySelector("#root")).render(
</body>
</html>`,
},
'Demo.tsx': {
'src/Demo.tsx': {
content: `import * as React from 'react';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
Expand All @@ -173,7 +173,7 @@ export default function BasicButtons() {
}
`,
},
'index.tsx': {
'src/index.tsx': {
content: `import * as React from 'react';
import * as ReactDOM from 'react-dom/client';
import { StyledEngineProvider } from '@mui/material/styles';
Expand Down
6 changes: 3 additions & 3 deletions docs/src/modules/sandbox/CodeSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const createReactApp = (demoData: DemoData) => {
'public/index.html': {
content: CRA.getHtml(demoData),
},
[`index.${ext}`]: {
[`src/index.${ext}`]: {
content: CRA.getRootIndex(demoData),
},
[`Demo.${ext}`]: {
[`src/Demo.${ext}`]: {
content: demoData.raw,
},
...(demoData.codeVariant === 'TS' && {
Expand Down Expand Up @@ -83,7 +83,7 @@ const createReactApp = (demoData: DemoData) => {
* @description should start with `/`, e.g. `/Demo.tsx`. If the extension is not provided,
* it will be appended based on the code variant.
*/
openSandbox: (initialFile: string = `/Demo.${ext}`) =>
openSandbox: (initialFile: string = `/src/Demo.${ext}`) =>
openSandbox({ files, codeVariant: demoData.codeVariant, initialFile }),
};
};
Expand Down

0 comments on commit 18d087f

Please sign in to comment.