mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:33:27 +00:00
Highlight root folder as drop target for external files (#15027)
GitOrigin-RevId: 2ef13ec9f167c39c7144ca90059a17e2a7c6e0b9
This commit is contained in:
parent
b3b31fb052
commit
9098d6fba7
2 changed files with 10 additions and 12 deletions
|
@ -16,14 +16,6 @@ function FileTreeDraggablePreviewLayer({ isOver }) {
|
|||
}))
|
||||
const ref = useRef()
|
||||
|
||||
const containerOffset = ref.current
|
||||
? ref.current.getBoundingClientRect()
|
||||
: null
|
||||
|
||||
if (!isDragging || !item.title) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
|
@ -31,9 +23,16 @@ function FileTreeDraggablePreviewLayer({ isOver }) {
|
|||
'dnd-droppable-hover': isOver,
|
||||
})}
|
||||
>
|
||||
<div style={getItemStyle(clientOffset, containerOffset)}>
|
||||
<DraggablePreviewItem title={item.title} />
|
||||
</div>
|
||||
{isDragging && item?.title && (
|
||||
<div
|
||||
style={getItemStyle(
|
||||
clientOffset,
|
||||
ref.current?.getBoundingClientRect()
|
||||
)}
|
||||
>
|
||||
<DraggablePreviewItem title={item.title} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -75,7 +75,6 @@ function FileTreeRootFolder() {
|
|||
files={fileTreeData.fileRefs}
|
||||
classes={{ root: 'file-tree-list' }}
|
||||
dropRef={dropRef}
|
||||
isOver={isOver}
|
||||
dataTestId="file-tree-list-root"
|
||||
/>
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue