mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
implemented ui for sources root
This commit is contained in:
49
scm-ui/src/repos/sources/components/FileTreeLeaf.js
Normal file
49
scm-ui/src/repos/sources/components/FileTreeLeaf.js
Normal file
@@ -0,0 +1,49 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import injectSheet from "react-jss";
|
||||
import { DateFromNow } from "@scm-manager/ui-components";
|
||||
import FileSize from "./FileSize";
|
||||
import FileIcon from "./FileIcon";
|
||||
import { Link } from "react-router-dom";
|
||||
import type { File } from "@scm-manager/ui-types";
|
||||
|
||||
const styles = {
|
||||
iconColumn: {
|
||||
width: "16px"
|
||||
}
|
||||
};
|
||||
|
||||
type Props = {
|
||||
file: File,
|
||||
|
||||
// context props
|
||||
classes: any
|
||||
};
|
||||
|
||||
class FileTreeLeaf extends React.Component<Props> {
|
||||
render() {
|
||||
const { file, classes } = this.props;
|
||||
|
||||
return (
|
||||
<tr>
|
||||
<td className={classes.iconColumn}>
|
||||
<Link to="#todo">
|
||||
<FileIcon file={file} />
|
||||
</Link>
|
||||
</td>
|
||||
<td>
|
||||
<Link to="#todo">{file.name}</Link>
|
||||
</td>
|
||||
<td>
|
||||
<FileSize bytes={file.length} />
|
||||
</td>
|
||||
<td>
|
||||
<DateFromNow date={file.lastModified} />
|
||||
</td>
|
||||
<td>{file.description}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectSheet(styles)(FileTreeLeaf);
|
||||
Reference in New Issue
Block a user