mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
fix a ton of typescript errors
This commit is contained in:
@@ -174,10 +174,4 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default compose(
|
||||
withRouter,
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)
|
||||
)(withTranslation("repos")(FileTree));
|
||||
export default compose(withRouter, connect(mapStateToProps, mapDispatchToProps))(withTranslation("repos")(FileTree));
|
||||
|
||||
@@ -88,14 +88,16 @@ class FileTreeLeaf extends React.Component<Props> {
|
||||
render() {
|
||||
const { file } = this.props;
|
||||
|
||||
const renderFileSize = (file: File) => <FileSize bytes={file.length} />;
|
||||
const renderFileSize = (file: File) => <FileSize bytes={file?.length ? file.length : 0} />;
|
||||
const renderCommitDate = (file: File) => <DateFromNow date={file.commitDate} />;
|
||||
|
||||
return (
|
||||
<tr>
|
||||
<td>{this.createFileIcon(file)}</td>
|
||||
<MinWidthTd className="is-word-break">{this.createFileName(file)}</MinWidthTd>
|
||||
<NoWrapTd className="is-hidden-mobile">{file.directory ? "" : this.contentIfPresent(file, "length", renderFileSize)}</NoWrapTd>
|
||||
<NoWrapTd className="is-hidden-mobile">
|
||||
{file.directory ? "" : this.contentIfPresent(file, "length", renderFileSize)}
|
||||
</NoWrapTd>
|
||||
<td className="is-hidden-mobile">{this.contentIfPresent(file, "commitDate", renderCommitDate)}</td>
|
||||
<MinWidthTd className={classNames("is-word-break", "is-hidden-touch")}>
|
||||
{this.contentIfPresent(file, "description", file => file.description)}
|
||||
|
||||
Reference in New Issue
Block a user