mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-28 08:06:56 +00:00
[Refactor] Do not run mobile functions on PC devices (#6408)
* 01 refactor dirent-list-item * 02 refactor upload links * 03 refactor linked devices * 04 refactor user-settings linked-devices * 05 refactor invitation view * 06 refactor share-links * 07 refactor starred page * 08 refactor share-admin folders * 09 refactor share-admin libraries * 10 refactor shared-libs
This commit is contained in:
@@ -128,17 +128,11 @@ class Item extends Component {
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
if (this.state.unlinked) {
|
||||
return null;
|
||||
}
|
||||
|
||||
renderDesktopItem = () => {
|
||||
const data = this.props.data;
|
||||
|
||||
let opClasses = 'sf3-font-delete1 sf3-font unlink-device action-icon';
|
||||
opClasses += this.state.isOpIconShown ? '' : ' invisible';
|
||||
|
||||
const desktopItem = (
|
||||
return (
|
||||
<tr onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut} onFocus={this.handleMouseOver}>
|
||||
<td>{data.platform}</td>
|
||||
<td>{data.device_name}</td>
|
||||
@@ -149,8 +143,11 @@ class Item extends Component {
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
|
||||
const mobileItem = (
|
||||
renderMobileItem = () => {
|
||||
const data = this.props.data;
|
||||
return (
|
||||
<tr>
|
||||
<td>
|
||||
{data.device_name}<br />
|
||||
@@ -178,10 +175,15 @@ class Item extends Component {
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
if (this.state.unlinked) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<React.Fragment>
|
||||
{this.props.isDesktop ? desktopItem : mobileItem}
|
||||
{this.props.isDesktop ? this.renderDesktopItem() : this.renderMobileItem()}
|
||||
{this.state.isConfirmUnlinkDialogOpen &&
|
||||
<ConfirmUnlinkDeviceDialog
|
||||
executeOperation={this.unlinkDevice}
|
||||
|
Reference in New Issue
Block a user