mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-05 06:09:57 -05:00
Using folder outline for empty folders.
This commit is contained in:
parent
207991ad80
commit
f1f1f42a1c
4 changed files with 35 additions and 70 deletions
|
|
@ -29,7 +29,7 @@ function depthIndentation(path) {
|
|||
|
||||
function Folder({folder, onFolderClick, sortData, selectedPath, onFileClick, onSelect}) {
|
||||
// Creates a single table row for a folder, or a row for itself and indented rows for its children.
|
||||
let {path, children} = folder;
|
||||
let {path, children, is_empty} = folder;
|
||||
const pathWithNoTrailingSlash = path.substring(0, path.length - 1);
|
||||
const name = path.substring(pathWithNoTrailingSlash.lastIndexOf('/') + 1);
|
||||
const f = <TableRow key={path}>
|
||||
|
|
@ -38,10 +38,10 @@ function Folder({folder, onFolderClick, sortData, selectedPath, onFileClick, onS
|
|||
</TableCell>
|
||||
<TableCell onClick={() => onFolderClick(path)} className='file-path'>
|
||||
{depthIndentation(pathWithNoTrailingSlash)}
|
||||
<Icon name='folder'/>
|
||||
{is_empty ? <Icon name='folder outline'/> : <Icon name='folder'/>}
|
||||
{name}
|
||||
</TableCell>
|
||||
<TableCell>({folder['child_count']})</TableCell>
|
||||
<TableCell/>
|
||||
</TableRow>;
|
||||
if (children && !_.isEmpty(children)) {
|
||||
// Folder has children, recursively display them.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue