feature: button to collapse all folders
This commit is contained in:
@ -118,11 +118,11 @@ export const FileExplorer = ({
|
||||
parentProject,
|
||||
openedRows,
|
||||
selectedRow,
|
||||
onRowClickCallback
|
||||
onRowClickCallback,
|
||||
}: {
|
||||
parentProject: Project,
|
||||
openedRows: {[key:string]: boolean},
|
||||
selectedRow: FileEntry | null,
|
||||
parentProject: Project
|
||||
openedRows: { [key: string]: boolean }
|
||||
selectedRow: FileEntry | null
|
||||
onRowClickCallback: (file: FileExplorerEntry) => void
|
||||
}) => {
|
||||
// Wrap the FileEntry in a FileExplorerEntry to keep track for more metadata
|
||||
|
@ -1,8 +1,11 @@
|
||||
import type { Project, FileEntry } from '@src/lib/project'
|
||||
import { FileExplorer, constructPath } from '@src/components/Explorer/FileExplorer'
|
||||
import type {FileExplorerEntry} from '@src/components/Explorer/FileExplorer'
|
||||
import {
|
||||
FileExplorer,
|
||||
constructPath,
|
||||
} from '@src/components/Explorer/FileExplorer'
|
||||
import type { FileExplorerEntry } from '@src/components/Explorer/FileExplorer'
|
||||
import { FileExplorerHeaderActions } from '@src/components/Explorer/FileExplorerHeaderActions'
|
||||
import {useState} from 'react'
|
||||
import { useState } from 'react'
|
||||
|
||||
/**
|
||||
* Wrap the header and the tree into a single component
|
||||
@ -52,18 +55,20 @@ export const ProjectExplorer = ({
|
||||
console.log('onRefreshExplorer TODO')
|
||||
}}
|
||||
onCollapseExplorer={() => {
|
||||
console.log('onCollapseExplorer TODO')
|
||||
setOpenedRows({})
|
||||
}}
|
||||
></FileExplorerHeaderActions>
|
||||
</div>
|
||||
</div>
|
||||
<div className="h-96 overflow-y-auto overflow-x-hidden">
|
||||
{project && <FileExplorer
|
||||
parentProject={project}
|
||||
openedRows={openedRows}
|
||||
selectedRow={selectedRow}
|
||||
onRowClickCallback={onRowClickCallback}
|
||||
></FileExplorer>}
|
||||
{project && (
|
||||
<FileExplorer
|
||||
parentProject={project}
|
||||
openedRows={openedRows}
|
||||
selectedRow={selectedRow}
|
||||
onRowClickCallback={onRowClickCallback}
|
||||
></FileExplorer>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
Reference in New Issue
Block a user