fixes
bunsenstraat 2 years ago
parent a8e3ece96c
commit de02a0a988
  1. 2
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  2. 28
      libs/remix-ui/workspace/src/lib/components/file-render.tsx

@ -619,7 +619,7 @@ export const EditorUI = (props: EditorUIProps) => {
language={editorModelsState[props.currentFile] ? editorModelsState[props.currentFile].language : 'text'}
onMount={handleEditorDidMount}
beforeMount={handleEditorWillMount}
options={{ glyphMargin: true, readOnly: true }}
options={{ glyphMargin: true, readOnly: (!editorRef.current || !props.currentFile) }}
defaultValue={defaultEditorValue}
/>

@ -7,7 +7,7 @@ import { getPathIcon } from '@remix-ui/helper'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { FileLabel } from './file-label'
import { fileDecoration, FileDecorationIcons } from '@remix-ui/file-decorators'
import {Draggable} from "@remix-ui/drag-n-drop"
import { Draggable } from "@remix-ui/drag-n-drop"
@ -84,23 +84,23 @@ export const FileRender = (props: RenderFileProps) => {
key={`${file.path + props.index}`}
label={<>
<div className="d-flex flex-row">
<Draggable isDraggable={props.focusEdit.element!==null} file={file} expandedPath={props.expandPath} handleClickFolder={props.handleClickFolder}>
<Draggable isDraggable={props.focusEdit.element !== null} file={file} expandedPath={props.expandPath} handleClickFolder={props.handleClickFolder}>
<FileLabel fileDecorations={props.fileDecorations} file={file} focusEdit={props.focusEdit} editModeOff={props.editModeOff} />
</Draggable>
<FileDecorationIcons file={file} fileDecorations={props.fileDecorations}/>
</div>
</>}
<FileDecorationIcons file={file} fileDecorations={props.fileDecorations} />
</div>
</>}
onClick={handleFolderClick}
onContextMenu={handleContextMenu}
labelClass={labelClass}
controlBehaviour={ props.ctrlKey }
controlBehaviour={props.ctrlKey}
expand={props.expandPath.includes(file.path)}
onMouseOver={handleMouseOver}
onMouseOut={handleMouseOut}
expandedPaths={props.expandPath}
>
{
file.child ? <TreeView id={`treeView${file.path}`} key={`treeView${file.path}`} {...spreadProps }>{
file.child ? <TreeView id={`treeView${file.path}`} key={`treeView${file.path}`} {...spreadProps}>{
Object.keys(file.child).map((key, index) => <FileRender
file={file.child[key]}
fileDecorations={props.fileDecorations}
@ -117,7 +117,7 @@ export const FileRender = (props: RenderFileProps) => {
key={index}
/>)
}
</TreeView> : <TreeView id={`treeView${file.path}`} key={`treeView${file.path}`} {...spreadProps }/>
</TreeView> : <TreeView id={`treeView${file.path}`} key={`treeView${file.path}`} {...spreadProps} />
}
</TreeViewItem>
)
@ -127,13 +127,13 @@ export const FileRender = (props: RenderFileProps) => {
id={`treeViewItem${file.path}`}
key={`treeView${file.path}`}
label={
<>
<div className="d-flex flex-row">
<Draggable isDraggable={props.focusEdit.element!==null} file={file} expandedPath={props.expandPath} handleClickFolder={props.handleClickFolder}>
<FileLabel fileDecorations={props.fileDecorations} file={file} focusEdit={props.focusEdit} editModeOff={props.editModeOff} />
<>
<Draggable isDraggable={props.focusEdit.element !== null} file={file} expandedPath={props.expandPath} handleClickFolder={props.handleClickFolder}>
<div className="d-flex flex-row">
<FileLabel fileDecorations={props.fileDecorations} file={file} focusEdit={props.focusEdit} editModeOff={props.editModeOff} />
<FileDecorationIcons file={file} fileDecorations={props.fileDecorations} />
</div>
</Draggable>
<FileDecorationIcons file={file} fileDecorations={props.fileDecorations}/>
</div>
</>
}
onClick={handleFileClick}

Loading…
Cancel
Save