mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #27384 from overleaf/dp-drag-file-tree-outline
Allow file tree and outline to be expandable and collapsible by dragging GitOrigin-RevId: e25f0d263b1446537cdb42ef52fe1c486e855773
This commit is contained in:
@@ -4,11 +4,18 @@ import { useRef } from 'react'
|
||||
import { ImperativePanelHandle } from 'react-resizable-panels'
|
||||
|
||||
export const useOutlinePane = () => {
|
||||
const { canShowOutline, outlineExpanded } = useOutlineContext()
|
||||
const { canShowOutline, outlineExpanded, expandOutline, collapseOutline } =
|
||||
useOutlineContext()
|
||||
const outlinePanelRef = useRef<ImperativePanelHandle>(null)
|
||||
const outlineEnabled = canShowOutline && outlineExpanded
|
||||
|
||||
useCollapsiblePanel(outlineEnabled, outlinePanelRef)
|
||||
|
||||
return { outlineEnabled, outlinePanelRef }
|
||||
return {
|
||||
outlineEnabled,
|
||||
canShowOutline,
|
||||
outlinePanelRef,
|
||||
expandOutline,
|
||||
collapseOutline,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user