overleaf/services/web/frontend/js/features/file-tree/components/file-tree-inner.tsx
ilkin-overleaf b05f8ad7e7 Merge pull request #14339 from overleaf/ii-filetree-empty-space-click-3
[web] Select project root folder improvements

GitOrigin-RevId: 48b80f26adf239215bf04d3db95a61ef35b5cf77
2023-08-18 12:11:06 +00:00

26 lines
639 B
TypeScript

import { useFileTreeSelectable } from '../contexts/file-tree-selectable'
type FileTreeInnerProps = {
children: React.ReactNode
}
function FileTreeInner({ children }: FileTreeInnerProps) {
const { setIsRootFolderSelected } = useFileTreeSelectable()
const handleFileTreeClick = () => {
setIsRootFolderSelected(true)
}
return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div
className="file-tree-inner"
onClick={handleFileTreeClick}
data-testid="file-tree-inner"
>
{children}
</div>
)
}
export default FileTreeInner