Skip to content

Commit a850d5c

Browse files
committed
add style to console editor div, remove styling hook
1 parent 0912253 commit a850d5c

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

client/modules/IDE/components/ConsoleInput.jsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,8 @@ function ConsoleInput({ theme, fontSize }) {
2424
mode: 'javascript',
2525
inputStyle: 'contenteditable'
2626
});
27-
28-
cmInstance.current.getWrapperElement().style['font-size'] = `${fontSize}px`;
2927
}, []);
3028

31-
useEffect(() => {
32-
if (cmInstance.current) {
33-
cmInstance.current.setOption('theme', `p5-${theme}`);
34-
cmInstance.current.getWrapperElement().style[
35-
'font-size'
36-
] = `${fontSize}px`;
37-
cmInstance.current.refresh();
38-
}
39-
}, [theme, fontSize]);
40-
4129
useEffect(() => {
4230
const handleEnterKey = (cm, e) => {
4331
if (e.key === 'Enter' && !e.shiftKey) {
@@ -146,7 +134,11 @@ function ConsoleInput({ theme, fontSize }) {
146134
}}
147135
/>
148136
</div>
149-
<div ref={codemirrorContainer} className="console__editor" />
137+
<div
138+
ref={codemirrorContainer}
139+
className="console__editor"
140+
style={{ fontSize: `${fontSize}px` }}
141+
/>
150142
</div>
151143
);
152144
}

0 commit comments

Comments
 (0)