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 Oct 9, 2024
1 parent 4b7c712 commit 7dfb53c
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 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,28 +667,26 @@ 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
{...getRootProps({
onClick: (event) => event.stopPropagation() // Prevents clicking TextArea from opening file dialog
})}
className={css(isLoading && fileUploadStyles.modifiers.loading)}
style={{ display: 'flex', flexDirection: 'column', flexGrow: '1' }}
>
{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 +698,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 7dfb53c

Please sign in to comment.