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:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user