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

[misc] modification for mobile (#4016)

This commit is contained in:
llj
2019-08-22 20:23:08 +08:00
committed by Daniel Pan
parent 2b9257acf9
commit 9996db6f5f
19 changed files with 88 additions and 138 deletions

View File

@@ -3,14 +3,13 @@ import { Dropdown, DropdownToggle, DropdownItem } from 'reactstrap';
import PropTypes from 'prop-types';
import moment from 'moment';
import { siteRoot, gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
// import { seafileAPI } from '../../utils/seafile-api';
// import Toast from '../toast';
import ModalPortal from '../modal-portal';
import WikiDeleteDialog from '../dialog/wiki-delete-dialog';
// import Rename from '../rename';
import { Utils } from '../../utils/utils';
const propTypes = {
wiki: PropTypes.object.isRequired,
// renameWiki: PropTypes.func.isRequired,
@@ -186,7 +185,7 @@ class WikiListItem extends Component {
return (
<Fragment>
{window.innerWidth >= 768 ? desktopItem : mobileItem}
{Utils.isDesktop() ? desktopItem : mobileItem}
{this.state.isShowDeleteDialog &&
<ModalPortal>
<WikiDeleteDialog

View File

@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import WikiListItem from './wiki-list-item';
import LibsMobileThead from '../libs-mobile-thead';
@@ -35,6 +36,7 @@ class WikiListView extends Component {
} else if (errorMsg) {
return <p className="error text-center">{errorMsg}</p>;
} else {
const isDesktop = Utils.isDesktop();
const desktopThead = (
<thead>
<tr>
@@ -47,8 +49,8 @@ class WikiListView extends Component {
</thead>
);
return (
<table className={window.innerWidth >= 768 ? '' : 'table-thead-hidden'}>
{window.innerWidth >= 768 ? desktopThead : <LibsMobileThead />}
<table className={isDesktop ? '' : 'table-thead-hidden'}>
{isDesktop ? desktopThead : <LibsMobileThead />}
<tbody>
{wikis.map((wiki, index) => {
return (