1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 09:21:54 +00:00

[my libs] mobile: improvement (#3839)

* [my libs] mobile: improvement

* modified 'more' icon
* modified background layer of op menu
* added 'star/unstar' to the op menu

* [my libs] mobile: redesigned 'sort'
This commit is contained in:
llj
2019-07-16 07:55:55 +08:00
committed by Daniel Pan
parent ea621c46c3
commit 957979254b
13 changed files with 140 additions and 23 deletions

View File

@@ -69,6 +69,10 @@ class MylibRepoListItem extends React.Component {
onMenuItemClick = (item) => {
switch(item) {
case 'Star':
case 'Unstar':
this.onStarRepo();
break;
case 'Share':
this.onShareToggle();
break;
@@ -109,10 +113,16 @@ class MylibRepoListItem extends React.Component {
if (this.state.isStarred) {
seafileAPI.unstarItem(this.props.repo.repo_id, '/').then(() => {
this.setState({isStarred: !this.state.isStarred});
if (window.innerWidth < 728) {
toaster.success(gettext('Successfully unstarred the library.'));
}
});
} else {
seafileAPI.starItem(this.props.repo.repo_id, '/').then(() => {
this.setState({isStarred: !this.state.isStarred});
if (window.innerWidth < 728) {
toaster.success(gettext('Successfully starred the library.'));
}
});
}
}
@@ -284,6 +294,7 @@ class MylibRepoListItem extends React.Component {
{repo.repo_name && (
<MylibRepoMenu
repo={this.props.repo}
isStarred={this.state.isStarred}
onMenuItemClick={this.onMenuItemClick}
onFreezedItem={this.props.onFreezedItem}
onUnfreezedItem={this.onUnfreezedItem}