chore(code): Make font size of the code editor a bit bigger

This commit is contained in:
Faruk AYDIN
2024-07-31 13:10:36 +02:00
committed by Ali BARIN
parent 268d8c8b7d
commit 60fdfc2b48

View File

@@ -24,17 +24,14 @@ function CodeEditor(props) {
editorRef.current = editor; editorRef.current = editor;
editor.onDidContentSizeChange((event) => { editor.onDidContentSizeChange((event) => {
const { const { contentHeight, contentHeightChanged } = event;
contentHeight,
contentHeightChanged,
} = event;
if (contentHeightChanged) { if (contentHeightChanged) {
// cap the editor height at 500px // cap the editor height at 500px
const editorContentHeight = Math.min(500, contentHeight); const editorContentHeight = Math.min(500, contentHeight);
setContainerHeight(editorContentHeight); setContainerHeight(editorContentHeight);
}; }
}); });
}; };
@@ -45,9 +42,7 @@ function CodeEditor(props) {
defaultValue={defaultValue || ''} defaultValue={defaultValue || ''}
control={control} control={control}
shouldUnregister={shouldUnregister} shouldUnregister={shouldUnregister}
render={({ render={({ field }) => (
field,
}) => (
<div style={{ paddingTop: 36, position: 'relative' }}> <div style={{ paddingTop: 36, position: 'relative' }}>
<InputLabelWrapper> <InputLabelWrapper>
<InputLabel <InputLabel
@@ -60,20 +55,26 @@ function CodeEditor(props) {
</InputLabel> </InputLabel>
</InputLabelWrapper> </InputLabelWrapper>
<div style={{ height: containerHeight, width: '100%' }} data-test={dataTest}> <div
style={{ height: containerHeight, width: '100%' }}
data-test={dataTest}
>
<Editor <Editor
{...field} {...field}
ref={containerRef} ref={containerRef}
defaultLanguage="javascript" defaultLanguage="javascript"
defaultValue={defaultValue} defaultValue={defaultValue}
onMount={handleEditorOnMount} onMount={handleEditorOnMount}
onChange={(value, event) => { field.onChange(value, event); }} onChange={(value, event) => {
field.onChange(value, event);
}}
options={{ options={{
fontSize: 13,
automaticLayout: true, automaticLayout: true,
bracketPairColorization: true, bracketPairColorization: true,
formatOnPaste: true, formatOnPaste: true,
minimap: { minimap: {
enabled: false enabled: false,
}, },
overviewRulerLanes: 0, overviewRulerLanes: 0,
readOnly: disabled, readOnly: disabled,
@@ -84,7 +85,6 @@ function CodeEditor(props) {
/> />
</div> </div>
</div> </div>
)} )}
/> />
); );