show Content if currect file is no directory

This commit is contained in:
Maren Süwer
2018-10-25 11:27:31 +02:00
parent 6ca66c27d1
commit 20df283b08
7 changed files with 141 additions and 53 deletions

View File

@@ -49,14 +49,18 @@ class FileTreeLeaf extends React.Component<Props> {
</Link>
);
}
return <FileIcon file={file} />;
return (
<Link to={this.createLink(file)}>
<FileIcon file={file} />
</Link>
);
};
createFileName = (file: File) => {
if (file.directory) {
return <Link to={this.createLink(file)}>{file.name}</Link>;
}
return file.name;
return <Link to={this.createLink(file)}>{file.name}</Link>;
};
render() {