YAML files will have code icon.

This commit is contained in:
Roland 2023-02-14 08:11:01 -07:00
parent f1f1f42a1c
commit 71654841bd
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 2 additions and 3 deletions

View file

@ -601,7 +601,7 @@ export function FileIcon({file, disabled = true, size = 'huge', ...props}) {
props['name'] = 'file';
props['color'] = mimetypeColor(mimetype);
if (mimetype) {
if (mimetype.startsWith('text/html') || mimetype.startsWith('application/json')) {
if (mimetype.startsWith('text/html') || mimetype.startsWith('application/json') || mimetype.startsWith('text/yaml')) {
props['name'] = 'file code';
} else if (mimetype.startsWith('application/pdf')) {
props['name'] = 'file pdf';

View file

@ -36,12 +36,11 @@ function Folder({folder, onFolderClick, sortData, selectedPath, onFileClick, onS
<TableCell collapsing>
<Checkbox checked={selectedPath === folder['path']} onChange={() => onSelect(folder['path'])}/>
</TableCell>
<TableCell onClick={() => onFolderClick(path)} className='file-path'>
<TableCell onClick={() => onFolderClick(path)} className='file-path' colSpan={2}>
{depthIndentation(pathWithNoTrailingSlash)}
{is_empty ? <Icon name='folder outline'/> : <Icon name='folder'/>}
{name}
</TableCell>
<TableCell/>
</TableRow>;
if (children && !_.isEmpty(children)) {
// Folder has children, recursively display them.