Skip to content

Commit

Permalink
Adjust to Coker's new suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccaalpert committed Sep 18, 2024
1 parent 4b7c712 commit cd0543f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,11 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {

const editor = (
<div
className={css(styles.codeEditorCode, isFullHeight && styles.modifiers.fullHeight)}
className={css(styles.codeEditorCode)}
ref={this.wrapperRef}
tabIndex={0}
dir="ltr"
style={{ height: '100%' }}
>
<Editor
height={height === '100%' ? undefined : height}
Expand All @@ -666,13 +667,13 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {

return (
<div
className={css(
styles.codeEditor,
isReadOnly && styles.modifiers.readOnly,
isFullHeight && styles.modifiers.fullHeight,
className
)}
className={css(styles.codeEditor, isReadOnly && styles.modifiers.readOnly, className)}
ref={this.ref}
style={
isFullHeight
? { height: '100%', display: 'flex', flexDirection: 'column' }
: { display: 'flex', flexDirection: 'column' }
}
>
{isUploadEnabled || providedEmptyState ? (
<div
Expand All @@ -683,11 +684,8 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
>
{editorHeader}
<div
className={css(
styles.codeEditorMain,
isDragActive && styles.modifiers.dragHover,
isFullHeight && styles.modifiers.fullHeight
)}
className={css(styles.codeEditorMain, isDragActive && styles.modifiers.dragHover)}
style={{ flexGrow: 1 }}
>
<div className={css(styles.codeEditorUpload)}>
<input {...getInputProps()} /* hidden, necessary for react-dropzone */ />
Expand All @@ -699,7 +697,7 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
<>
{editorHeader}
{showEditor && (
<div className={css(styles.codeEditorMain, isFullHeight && styles.modifiers.fullHeight)}>
<div className={css(styles.codeEditorMain)} style={{ flexGrow: 1 }}>
{editor}
</div>
)}
Expand Down

0 comments on commit cd0543f

Please sign in to comment.