MSP-3486 add theme in Editor in ConfigurationEditorCode

This commit is contained in:
Anastasiia committed 2024-06-28 14:27:52 +07:00
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 Editor from '@monaco-editor/react'
import { ConfigType } from '@pages/ModulesPage/module.type.ts'
import { message } from 'antd'
import { Context } from '@stores/index.tsx'
const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBtn= () => {}, bufConfig, setBufConfig }) => {
const { changeTheme } = useContext(Context)
const debounce = (func: (...args: any[]) => void, wait: number) => {
let timeout: NodeJS.Timeout
return (...args: []) => {
@@ -44,7 +46,7 @@ const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBt
width="auto"
height="100vh"
language="json"
theme="vs-white"
theme={changeTheme ? 'vs-dark' : 'vs-white'}
value={editorValue}
onChange={handleChange}
options={{