@@ -13,6 +13,7 @@ import {useCodeValidator} from '../../hooks/useCodeValidator';
1313import { useMainState } from '../../store/main' ;
1414import { useSettingsState } from '../../store/settings' ;
1515import { EditorProps , ViewModeItem } from '../../types' ;
16+ import { FormTab } from '../../types/index' ;
1617import { addCustomDecorator , checkIsMobile , getBlockId } from '../../utils' ;
1718import { Form } from '../Form/Form' ;
1819
@@ -22,6 +23,7 @@ export const Editor = ({
2223 providerProps,
2324 transformContent,
2425 deviceEmulationSettings,
26+ theme : editorTheme ,
2527 ...rest
2628} : EditorProps ) => {
2729 const {
@@ -35,7 +37,7 @@ export const Editor = ({
3537 } = useMainState ( rest ) ;
3638 const {
3739 viewMode,
38- theme,
40+ theme : constructorTheme ,
3941 onViewModeUpdate,
4042 onThemeUpdate,
4143 formTab,
@@ -45,6 +47,9 @@ export const Editor = ({
4547 } = useSettingsState ( ) ;
4648
4749 const isEditingMode = viewMode === ViewModeItem . Edititng ;
50+ const isCodeOnlyMode =
51+ codeFullscreeModeOn && formTab === FormTab . Code && viewMode === ViewModeItem . Edititng ;
52+
4853 const transformedContent = useMemo (
4954 ( ) => ( transformContent ? transformContent ( content , { viewMode} ) : content ) ,
5055 [ content , transformContent , viewMode ] ,
@@ -95,11 +100,20 @@ export const Editor = ({
95100 providerProps : {
96101 ...providerProps ,
97102 isMobile : checkIsMobile ( viewMode ) ,
98- theme,
103+ theme : constructorTheme ,
99104 } ,
100105 deviceEmulationSettings,
106+ theme : editorTheme ,
101107 } ) ,
102- [ providerProps , rest . custom , viewMode , transformedContent , deviceEmulationSettings , theme ] ,
108+ [
109+ providerProps ,
110+ rest . custom ,
111+ viewMode ,
112+ transformedContent ,
113+ deviceEmulationSettings ,
114+ constructorTheme ,
115+ editorTheme ,
116+ ] ,
103117 ) ;
104118
105119 useEffect ( ( ) => {
@@ -111,7 +125,7 @@ export const Editor = ({
111125 < Layout
112126 mode = { viewMode }
113127 onModeChange = { onViewModeUpdate }
114- theme = { theme }
128+ theme = { constructorTheme }
115129 onThemeChange = { onThemeUpdate }
116130 >
117131 { isEditingMode && (
@@ -130,14 +144,16 @@ export const Editor = ({
130144 />
131145 </ Layout . Left >
132146 ) }
133- < Layout . Right >
134- < ErrorBoundary key = { errorBoundaryState } >
135- < PageConstructorProvider { ...providerProps } theme = { theme } >
136- < PageConstructor { ...outgoingProps } />
137- </ PageConstructorProvider >
138- </ ErrorBoundary >
139- { isEditingMode && < AddBlock onAdd = { onAdd } /> }
140- </ Layout . Right >
147+ { ! isCodeOnlyMode && (
148+ < Layout . Right >
149+ < ErrorBoundary key = { errorBoundaryState } >
150+ < PageConstructorProvider { ...providerProps } theme = { constructorTheme } >
151+ < PageConstructor { ...outgoingProps } />
152+ </ PageConstructorProvider >
153+ </ ErrorBoundary >
154+ { isEditingMode && < AddBlock onAdd = { onAdd } /> }
155+ </ Layout . Right >
156+ ) }
141157 </ Layout >
142158 </ EditorContext . Provider >
143159 ) ;
0 commit comments