Make width optional for text editor

This commit is contained in:
Sam Nolan 2022-04-01 21:34:37 +11:00
parent 423f1cbe98
commit 1d735263ed

View File

@ -10,7 +10,7 @@ interface CodeEditorProps {
value : string, value : string,
onChange : (value: string) => void, onChange : (value: string) => void,
oneLine : boolean, oneLine : boolean,
width: number width?: number
} }
export let CodeEditor : FC<CodeEditorProps> = (props) => export let CodeEditor : FC<CodeEditorProps> = (props) =>
@ -18,8 +18,8 @@ export let CodeEditor : FC<CodeEditorProps> = (props) =>
value={props.value} value={props.value}
mode="golang" mode="golang"
theme="github" theme="github"
width={props.width + "px"} width={props.width ? props.width + 'px' : '500px'}
height={props.oneLine ? "1em" : "500px"} height={props.oneLine ? "1.2em" : "500px"}
showGutter={false} showGutter={false}
highlightActiveLine={false} highlightActiveLine={false}
showPrintMargin={false} showPrintMargin={false}