1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 19:01:42 +00:00

Prop type check repair (#2919)

* repair intent check wraning

* change doublequote to singlequote, add semicolon

* optimized code

* modify type-check wraning
This commit is contained in:
杨顺强
2019-01-31 17:37:02 +08:00
committed by Daniel Pan
parent 06f25f05f2
commit e57701fa38
74 changed files with 714 additions and 700 deletions

View File

@@ -15,6 +15,7 @@ const propTypes = {
onNodeDragStart: PropTypes.func.isRequired,
onFreezedItem: PropTypes.func.isRequired,
onUnFreezedItem: PropTypes.func.isRequired,
onMenuItemClick: PropTypes.func,
};
class TreeNodeView extends React.Component {
@@ -76,20 +77,20 @@ class TreeNodeView extends React.Component {
let icon = '';
let type = '';
if (node.object.type === 'dir') {
icon = <i className="far fa-folder"></i>
icon = <i className="far fa-folder"></i>;
type = 'dir';
} else {
let index = node.object.name.lastIndexOf('.');
if (index === -1) {
icon = <i className="far fa-file"></i>
icon = <i className="far fa-file"></i>;
type = 'file';
} else {
let suffix = node.object.name.slice(index).toLowerCase();
if (suffix === '.png' || suffix === '.jpg') {
icon = <i className="far fa-image"></i>
icon = <i className="far fa-image"></i>;
type = 'image';
} else {
icon = <i className="far fa-file"></i>
icon = <i className="far fa-file"></i>;
type = 'file';
}
}