@@ -2,7 +2,7 @@ import React, { ForwardedRef, forwardRef, ReactElement, useEffect, useMemo, useR
22import debounce from 'lodash.debounce'
33import { monaco , createEditor , getMonacoLanguage , updateEditorKeybindingsMode , registerEditorOpenHandler } from '@codingame/monaco-editor-wrapper'
44import { IEditorOptions } from 'vscode/service-override/modelEditor'
5- import { useDeepMemo , useLastValueRef , useLastVersion , useColorTheme } from './hooks'
5+ import { useDeepMemo , useLastValueRef , useLastVersion , useThemeColors } from './hooks'
66import './style'
77
88const STATUS_BAR_HEIGHT = 20
@@ -123,7 +123,7 @@ function MonacoEditor ({
123123 const preventTriggerChangeEventRef = useRef < boolean > ( false )
124124
125125 const [ height , setHeight ] = useState < number | string > ( requestedHeight !== 'auto' ? requestedHeight : 50 )
126- const colorTheme = useColorTheme ( )
126+ const [ statusBarBackground , statusBarForeground , statusBarBorder ] = useThemeColors ( [ 'statusBar.background' , 'statusBar.foreground' , 'statusBar.border' ] )
127127
128128 const containerRef = useRef < HTMLDivElement > ( null )
129129 const statusBarRef = useRef < HTMLDivElement > ( null )
@@ -334,11 +334,11 @@ function MonacoEditor ({
334334
335335 const statusBarStyle = useMemo ( ( ) => {
336336 return {
337- backgroundColor : colorTheme . getColor ( 'statusBar.background' ) ?. toString ( ) ?? '#007ACC' ,
338- color : colorTheme . getColor ( 'statusBar.foreground' ) ?. toString ( ) ?? '#FFFFFF' ,
339- borderTop : `1px solid ${ colorTheme . getColor ( 'statusBar.border' ) ?. toString ( ) ?? '#FFFFFF' } `
337+ backgroundColor : statusBarBackground ?? '#007ACC' ,
338+ color : statusBarForeground ?? '#FFFFFF' ,
339+ borderTop : `1px solid ${ statusBarBorder ?? '#FFFFFF' } `
340340 }
341- } , [ colorTheme ] )
341+ } , [ statusBarBackground , statusBarBorder , statusBarForeground ] )
342342
343343 return (
344344 < div className = 'react-monaco-editor-react-container' style = { { height } } >
0 commit comments