File tree Expand file tree Collapse file tree 5 files changed +9
-13
lines changed
app/components/code-capture Expand file tree Collapse file tree 5 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export default function ControlOptions() {
5252 < Select
5353 onValueChange = { ( value ) => {
5454 changeEditorTheme ( value ) ;
55- updateEditorWindowTheme ( ) ;
55+ updateEditorWindowTheme ( value ) ;
5656 } }
5757 >
5858 < SelectTrigger >
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import useStore from "@/lib/store/store";
55export default function WindowHeader ( ) {
66 const editorThemeColors = useStore ( ( state ) => state . editorThemeColors ) ;
77
8- console . log ( "edit" , editorThemeColors ) ;
9-
108 return (
119 < div
1210 className = "window-header rounded-t-md flex justify-between w-full py-3 px-4 items-center"
Original file line number Diff line number Diff line change @@ -2,17 +2,14 @@ import { applyTheme } from "@/lib/editor/themes/apply-theme";
22import useStore from "@/lib/store/store" ;
33
44export default function useEditorTheme ( ) {
5-
6- const editorTheme = useStore ( ( state ) => state . editorTheme ) ;
7- const editorThemeColors = useStore ( ( state ) => state . editorThemeColors ) ;
5+
86 const changeEditorThemeColors = useStore (
97 ( state ) => state . changeEditorThemeColors
108 ) ;
119
12- const updateEditorWindowTheme = async ( ) => {
13- const colors = await applyTheme ( editorTheme ) ;
10+ const updateEditorWindowTheme = async ( themeName : string ) => {
11+ const colors = await applyTheme ( themeName ) ;
1412 changeEditorThemeColors ( colors ) ;
15- 13 ;
1613 } ;
1714
1815 return { updateEditorWindowTheme } ;
Original file line number Diff line number Diff line change 11import { loader } from "@monaco-editor/react" ;
22
33const applyTheme = async ( themeName : string ) => {
4- console . log ( themeName ) ;
4+ console . log ( "themeName" , themeName ) ;
5+
56 let themeData = await import ( `monaco-themes/themes/${ themeName } .json` ) ;
67
78 themeName &&
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export default function MonacoEditor() {
1313 const windowWidth = useStore ( ( state ) => state . windowWidth ) ;
1414 const changeWindowWidth = useStore ( ( state ) => state . changeWindowWidth ) ;
1515
16+ const editorTheme = useStore ( ( state ) => state . editorTheme ) ;
17+
1618 const editorLanguage = useStore ( ( state ) => state . editorLanguage ) ;
1719
1820 // to adjust editor width based on its content
@@ -27,8 +29,6 @@ export default function MonacoEditor() {
2729 }
2830 } ;
2931
30- console . log ( "changed language" , editorLanguage ) ;
31-
3232 return (
3333 < Editor
3434 language = { editorLanguage }
@@ -41,7 +41,7 @@ export default function MonacoEditor() {
4141 theme = "vs-dark"
4242 onMount = { ( editor ) => {
4343 editorRef . current = editor ;
44- updateEditorWindowTheme ( ) ;
44+ updateEditorWindowTheme ( editorTheme ) ;
4545 } }
4646 onChange = { ( ) => {
4747 controlEditorWidth ( ) ;
You can’t perform that action at this time.
0 commit comments