Skip to content

Commit

Permalink
try adding ace editor
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-laplante committed May 11, 2024
1 parent fd6a308 commit e0ee034
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 11 deletions.
43 changes: 35 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@
"@mantine/hooks": "^7.9.1",
"@types/react": "^18.2.77",
"@types/react-dom": "^18.2.25",
"ace-builds": "^1.33.1",
"classnames": "^2.5.1",
"pyodide": "^0.25.1",
"react": "^18.2.0",
"react-ace": "^11.0.1",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.13"
}
Expand Down
21 changes: 18 additions & 3 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { MantineProvider, createTheme, MantineColorsTuple } from '@mantine/core'
import FetchWithProgress from "./FetchWithProgress";
import PyodideLoader from "./PyodideLoader";
import pyodide from "pyodide";
import AceEditor from "react-ace";

const myColor: MantineColorsTuple = [
'#e4f8ff',
Expand All @@ -25,7 +26,7 @@ const theme = createTheme({
}
});

export const App: React.FC = () => {
const Inner: React.FC = () => {
const [data, setData] = useState<ArrayBuffer | null>(null);
const [pyodideModule, setPyodideModule] = useState<pyodide | null>(null);
const [ran, setRan] = useState<boolean>(false);
Expand Down Expand Up @@ -181,10 +182,24 @@ print(sys.meta_path)
go();
}, [data, pyodideModule, ran, setRan]);


return <>
<PyodideLoader pyodide={pyodideModule} setPyodide={setPyodideModule} />
<FetchWithProgress url={"assets/bitbake-2.8.0.zip"} data={data} setData={setData}/>
</>;
}

export const App: React.FC = () => {

return (
<MantineProvider theme={theme}>
<PyodideLoader pyodide={pyodideModule} setPyodide={setPyodideModule} />
<FetchWithProgress url={"assets/bitbake-2.8.0.zip"} data={data} setData={setData}/>
<AceEditor
mode="java"
theme="github"
name="UNIQUE_ID_OF_DIV"
editorProps={{ $blockScrolling: true }}
/>
<Inner/>
</MantineProvider>
);
};

0 comments on commit e0ee034

Please sign in to comment.