File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/components/Editor/Runners/PythonRunner/PyodideRunner Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import VisualOutputPane from "./VisualOutputPane";
1818import OutputViewToggle from "../OutputViewToggle" ;
1919import { SettingsContext } from "../../../../../utils/settings" ;
2020import RunnerControls from "../../../../RunButton/RunnerControls" ;
21+ import { useCookies } from "react-cookie" ;
2122// import "prismjs/plugins/highlight-keywords/prism-highlight-keywords.js";
2223// import Prism from "prismjs";
2324
@@ -69,6 +70,11 @@ const PyodideRunner = (props) => {
6970 const [ inputStack , setInputStack ] = useState ( [ ] ) ;
7071 const [ indentationLevel , setIndentationLevel ] = useState ( 0 ) ;
7172 const [ awaitingInput , setAwaitingInput ] = useState ( false ) ;
73+ const [ cookies ] = useCookies ( [ "theme" ] ) ;
74+ const defaultTheme = window . matchMedia ( "(prefers-color-scheme:dark)" ) . matches
75+ ? "dark"
76+ : "light" ;
77+ const theme = cookies . theme || defaultTheme ;
7278
7379 const prependToInputStack = ( input ) => {
7480 setInputStack ( ( prevInputStack ) => {
@@ -482,7 +488,7 @@ const PyodideRunner = (props) => {
482488 < TabPanel key = { 1 } >
483489 < iframe
484490 title = "console"
485- src = " http://localhost:3012/en/embed/viewer/ipython-console?browserPreview=true& autoRun = true "
491+ src = { ` http://localhost:3012/en/embed/viewer/ipython-console?browserPreview=true&autoRun=true&theme= ${ theme } ` }
486492 crossOrigin
487493 style = { { width : "100%" , height : "100%" } }
488494 />
You can’t perform that action at this time.
0 commit comments