diff --git a/frontend/src/components/toolbar/invitations-toolbar.js b/frontend/src/components/toolbar/invitations-toolbar.js
index 63999e0c53..af5880899e 100644
--- a/frontend/src/components/toolbar/invitations-toolbar.js
+++ b/frontend/src/components/toolbar/invitations-toolbar.js
@@ -24,16 +24,15 @@ class InvitationsToolbar extends React.Component {
-
+ {window.innerWidth >= 768 ? (
-
-
-
-
+ ) : (
+
+ )}
diff --git a/frontend/src/pages/invitations/invitations-view.js b/frontend/src/pages/invitations/invitations-view.js
index 8b2dad0dcf..1769fe2c69 100644
--- a/frontend/src/pages/invitations/invitations-view.js
+++ b/frontend/src/pages/invitations/invitations-view.js
@@ -1,7 +1,8 @@
import React, { Component, Fragment } from 'react';
+import { Dropdown, DropdownToggle, DropdownItem } from 'reactstrap';
import PropTypes from 'prop-types';
import moment from 'moment';
-import { gettext, siteRoot, loginUrl, canInvitePeople } from '../../utils/constants';
+import { gettext, loginUrl } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import { seafileAPI } from '../../utils/seafile-api';
import InvitationsToolbar from '../../components/toolbar/invitations-toolbar';
@@ -19,10 +20,17 @@ class Item extends React.Component {
super(props);
this.state = {
isOpIconShown: false,
+ isOpMenuOpen: false, // for mobile
isRevokeDialogOpen: false
};
}
+ toggleOpMenu = () => {
+ this.setState({
+ isOpMenuOpen: !this.state.isOpMenuOpen
+ });
+ }
+
onMouseEnter = () => {
this.setState({
isOpIconShown: true
@@ -70,32 +78,70 @@ class Item extends React.Component {
return null;
}
- const invitationItem = this.props.invitation;
- const operation = invitationItem.accept_time ?
-
- :
-
- ;
+ const item = this.props.invitation;
+
+ const desktopItem = (
+
+ {item.accepter} |
+ {moment(item.invite_time).format('YYYY-MM-DD')} |
+ {moment(item.expire_time).format('YYYY-MM-DD')} |
+ {item.accept_time && } |
+
+ {isOpIconShown && (
+ item.accept_time ?
+
+ :
+
+
+ )}
+ |
+
+ );
+
+ const mobileItem = (
+
+
+ {item.accepter}
+ {moment(item.invite_time).format('YYYY-MM-DD')}({gettext('Invite Time')})
+ {moment(item.expire_time).format('YYYY-MM-DD')}({gettext('Expiration')})
+ {item.accept_time && gettext('Accepted')}
+ |
+
+
+
+
+
+
+ {item.accept_time ?
+ {gettext('Revoke Access')} :
+ {gettext('Delete')}
+ }
+
+
+
+ |
+
+ );
return (
-
- {invitationItem.accepter} |
- {moment(invitationItem.invite_time).format('YYYY-MM-DD')} |
- {moment(invitationItem.expire_time).format('YYYY-MM-DD')} |
- {invitationItem.accept_time && } |
- {isOpIconShown && operation} |
-
+ {this.props.isDesktop ? desktopItem : mobileItem}
{isRevokeDialogOpen &&
@@ -138,23 +184,32 @@ class Content extends Component {
);
}
+ const isDesktop = Utils.isDesktop();
return (
-
+
-
- {gettext('Email')} |
- {gettext('Invite Time')} |
- {gettext('Expiration')} |
- {gettext('Accepted')} |
- |
-
+ {isDesktop ?
+
+ {gettext('Email')} |
+ {gettext('Invite Time')} |
+ {gettext('Expiration')} |
+ {gettext('Accepted')} |
+ |
+
+ :
+
+ |
+ |
+
+ }
{invitationsList.map((invitation, index) => {
return (
);
})}