From 1d735263eda7f4e1cb0f109c606b994761ccc68c Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Fri, 1 Apr 2022 21:34:37 +1100 Subject: [PATCH] Make width optional for text editor --- packages/components/src/CodeEditor.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/CodeEditor.tsx b/packages/components/src/CodeEditor.tsx index d00d52d6..a70077bc 100644 --- a/packages/components/src/CodeEditor.tsx +++ b/packages/components/src/CodeEditor.tsx @@ -10,7 +10,7 @@ interface CodeEditorProps { value : string, onChange : (value: string) => void, oneLine : boolean, - width: number + width?: number } export let CodeEditor : FC = (props) => @@ -18,8 +18,8 @@ export let CodeEditor : FC = (props) => value={props.value} mode="golang" theme="github" - width={props.width + "px"} - height={props.oneLine ? "1em" : "500px"} + width={props.width ? props.width + 'px' : '500px'} + height={props.oneLine ? "1.2em" : "500px"} showGutter={false} highlightActiveLine={false} showPrintMargin={false}