@@ -14,7 +14,7 @@ import { useColumnResize } from "../hooks/useColumnResize";
14
14
import PropTypes from "prop-types" ;
15
15
import { dateStringValidator , urlValidator } from "../validators/propValidators" ;
16
16
import { TranslationProvider } from "../contexts/TranslationProvider" ;
17
- import { useMemo } from "react" ;
17
+ import { useMemo , useState } from "react" ;
18
18
import { defaultPermissions } from "../constants" ;
19
19
import "./FileManager.scss" ;
20
20
@@ -49,7 +49,9 @@ const FileManager = ({
49
49
fontFamily = "Nunito Sans, sans-serif" ,
50
50
language = "en" ,
51
51
permissions : userPermissions = { } ,
52
+ showNavigationPane = true ,
52
53
} ) => {
54
+ const [ isNavigationPaneOpen , setNavigationPaneOpen ] = useState ( showNavigationPane ) ;
53
55
const triggerAction = useTriggerAction ( ) ;
54
56
const { containerRef, colSizes, isDragging, handleMouseMove, handleMouseUp, handleMouseDown } =
55
57
useColumnResize ( 20 , 80 ) ;
@@ -86,16 +88,25 @@ const FileManager = ({
86
88
onMouseUp = { handleMouseUp }
87
89
className = "files-container"
88
90
>
89
- < div className = "navigation-pane" style = { { width : colSizes . col1 + "%" } } >
91
+ < div
92
+ className = "navigation-pane"
93
+ style = { {
94
+ width : colSizes . col1 + "%" ,
95
+ display : isNavigationPaneOpen ? "block" : "none" ,
96
+ } }
97
+ >
90
98
< NavigationPane onFileOpen = { onFileOpen } />
91
99
< div
92
100
className = { `sidebar-resize ${ isDragging ? "sidebar-dragging" : "" } ` }
93
101
onMouseDown = { handleMouseDown }
94
102
/>
95
103
</ div >
96
104
97
- < div className = "folders-preview" style = { { width : colSizes . col2 + "%" } } >
98
- < BreadCrumb />
105
+ < div className = "folders-preview" style = { { width : ( isNavigationPaneOpen ? colSizes . col2 : 100 ) + "%" } } >
106
+ < BreadCrumb
107
+ isNavigationPaneOpen = { isNavigationPaneOpen }
108
+ setNavigationPaneOpen = { setNavigationPaneOpen }
109
+ />
99
110
< FileList
100
111
onCreateFolder = { onCreateFolder }
101
112
onRename = { onRename }
@@ -184,6 +195,7 @@ FileManager.propTypes = {
184
195
download : PropTypes . bool ,
185
196
delete : PropTypes . bool ,
186
197
} ) ,
198
+ showNavigationPane : PropTypes . bool ,
187
199
} ;
188
200
189
201
export default FileManager ;
0 commit comments