File tree 1 file changed +7
-1
lines changed
src/components/Editor/Runners/PythonRunner/PyodideRunner
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";
18
18
import OutputViewToggle from "../OutputViewToggle" ;
19
19
import { SettingsContext } from "../../../../../utils/settings" ;
20
20
import RunnerControls from "../../../../RunButton/RunnerControls" ;
21
+ import { useCookies } from "react-cookie" ;
21
22
// import "prismjs/plugins/highlight-keywords/prism-highlight-keywords.js";
22
23
// import Prism from "prismjs";
23
24
@@ -69,6 +70,11 @@ const PyodideRunner = (props) => {
69
70
const [ inputStack , setInputStack ] = useState ( [ ] ) ;
70
71
const [ indentationLevel , setIndentationLevel ] = useState ( 0 ) ;
71
72
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 ;
72
78
73
79
const prependToInputStack = ( input ) => {
74
80
setInputStack ( ( prevInputStack ) => {
@@ -482,7 +488,7 @@ const PyodideRunner = (props) => {
482
488
< TabPanel key = { 1 } >
483
489
< iframe
484
490
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 } ` }
486
492
crossOrigin
487
493
style = { { width : "100%" , height : "100%" } }
488
494
/>
You can’t perform that action at this time.
0 commit comments