MSP-3486 add theme in Editor in ConfigurationEditorCode
This commit is contained in:
1 parent
e78faf9b9b
commit
71d685efe9
1 file changed
+4
-2
@@ -1,10 +1,12 @@
|
|||||||
import { FC } from 'react'
|
import { FC, useContext } from 'react'
|
||||||
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage'
|
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage'
|
||||||
import Editor from '@monaco-editor/react'
|
import Editor from '@monaco-editor/react'
|
||||||
import { ConfigType } from '@pages/ModulesPage/module.type.ts'
|
import { ConfigType } from '@pages/ModulesPage/module.type.ts'
|
||||||
import { message } from 'antd'
|
import { message } from 'antd'
|
||||||
|
import { Context } from '@stores/index.tsx'
|
||||||
|
|
||||||
const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBtn= () => {}, bufConfig, setBufConfig }) => {
|
const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBtn= () => {}, bufConfig, setBufConfig }) => {
|
||||||
|
const { changeTheme } = useContext(Context)
|
||||||
const debounce = (func: (...args: any[]) => void, wait: number) => {
|
const debounce = (func: (...args: any[]) => void, wait: number) => {
|
||||||
let timeout: NodeJS.Timeout
|
let timeout: NodeJS.Timeout
|
||||||
return (...args: []) => {
|
return (...args: []) => {
|
||||||
@@ -44,7 +46,7 @@ const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBt
|
|||||||
width="auto"
|
width="auto"
|
||||||
height="100vh"
|
height="100vh"
|
||||||
language="json"
|
language="json"
|
||||||
theme="vs-white"
|
theme={changeTheme ? 'vs-dark' : 'vs-white'}
|
||||||
value={editorValue}
|
value={editorValue}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
Reference in new issue
Block a user