mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 09:21:54 +00:00
Fix eslint warnings (#5635)
* 01 fix eslint warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings
This commit is contained in:
@@ -19,7 +19,8 @@ const propTypes = {
|
||||
onItemDelete: PropTypes.func,
|
||||
onItemDetails: PropTypes.func,
|
||||
onItemRename: PropTypes.func,
|
||||
hasNextPage: PropTypes.bool
|
||||
hasNextPage: PropTypes.bool,
|
||||
onMonitorRepo: PropTypes.func,
|
||||
};
|
||||
|
||||
class SharedRepoListView extends React.Component {
|
||||
@@ -36,21 +37,21 @@ class SharedRepoListView extends React.Component {
|
||||
const sortBy = 'name';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortItems(sortBy, sortOrder);
|
||||
}
|
||||
};
|
||||
|
||||
sortByTime = (e) => {
|
||||
e.preventDefault();
|
||||
const sortBy = 'time';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortItems(sortBy, sortOrder);
|
||||
}
|
||||
};
|
||||
|
||||
sortBySize = (e) => {
|
||||
e.preventDefault();
|
||||
const sortBy = 'size';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortItems(sortBy, sortOrder);
|
||||
}
|
||||
};
|
||||
|
||||
getSortMetaData = () => {
|
||||
return {
|
||||
@@ -59,15 +60,15 @@ class SharedRepoListView extends React.Component {
|
||||
sortBySize: this.props.sortBy == 'size',
|
||||
sortIcon: this.props.sortOrder == 'asc' ? <span className="fas fa-caret-up"></span> : <span className="fas fa-caret-down"></span>
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
onFreezedItem = () => {
|
||||
this.setState({isItemFreezed: true});
|
||||
}
|
||||
};
|
||||
|
||||
onUnfreezedItem = () => {
|
||||
this.setState({isItemFreezed: false});
|
||||
}
|
||||
};
|
||||
|
||||
onItemRename = (repo, newName) => {
|
||||
let isDuplicated = this.props.repoList.some(item => {
|
||||
@@ -80,7 +81,7 @@ class SharedRepoListView extends React.Component {
|
||||
return false;
|
||||
}
|
||||
this.props.onItemRename(repo, newName);
|
||||
}
|
||||
};
|
||||
|
||||
renderRepoListView = () => {
|
||||
return (
|
||||
@@ -105,7 +106,7 @@ class SharedRepoListView extends React.Component {
|
||||
})}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
renderPCUI = () => {
|
||||
let isShowTableThread = this.props.isShowTableThread !== undefined ? this.props.isShowTableThread : true;
|
||||
@@ -130,7 +131,7 @@ class SharedRepoListView extends React.Component {
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
renderMobileUI = () => {
|
||||
return (
|
||||
@@ -141,7 +142,7 @@ class SharedRepoListView extends React.Component {
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const table = Utils.isDesktop() ? this.renderPCUI() : this.renderMobileUI();
|
||||
|
Reference in New Issue
Block a user