mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
change empty tips (#6565)
* [draft] change empty tips * remove useless codes
This commit is contained in:
@@ -52,10 +52,12 @@ class MyLibsDeleted extends Component {
|
||||
<ModalBody className="my-deleted-repos-container">
|
||||
{this.state.isLoading && <Loading />}
|
||||
{(!this.state.isLoading && repos.length === 0) &&
|
||||
<EmptyTip forDialog={true} className="my-deleted-repos-empty-tip">
|
||||
<h2 className="h6 font-weight-normal">{gettext('No deleted libraries')}</h2>
|
||||
<p className="empty-explanation">{gettext('You have not deleted any libraries in the last {placeholder} days. A deleted library will be cleaned automatically after this period.').replace('{placeholder}', trashReposExpireDays)}</p>
|
||||
</EmptyTip>
|
||||
<EmptyTip
|
||||
forDialog={true}
|
||||
className="my-deleted-repos-empty-tip"
|
||||
title={gettext('No deleted libraries')}
|
||||
text={gettext('You have not deleted any libraries in the last {placeholder} days. A deleted library will be cleaned automatically after this period.').replace('{placeholder}', trashReposExpireDays)}
|
||||
/>
|
||||
}
|
||||
{repos.length !== 0 &&
|
||||
<div>
|
||||
|
@@ -175,9 +175,7 @@ class RepoShareAdminGroupShares extends Component {
|
||||
{loading && <Loading />}
|
||||
{!loading && errorMsg && <p className="error text-center mt-8">{errorMsg}</p>}
|
||||
{!loading && !errorMsg && !items.length &&
|
||||
<EmptyTip forDialog={true}>
|
||||
<p className="text-secondary">{gettext('No group shares')}</p>
|
||||
</EmptyTip>
|
||||
<EmptyTip forDialog={true} text={gettext('No group shares')}/>
|
||||
}
|
||||
{!loading && !errorMsg && items.length > 0 &&
|
||||
<table className="table-hover">
|
||||
|
@@ -128,9 +128,7 @@ class RepoShareAdminShareLinks extends Component {
|
||||
{loading && <Loading />}
|
||||
{!loading && errorMsg && <p className="error text-center mt-8">{errorMsg}</p>}
|
||||
{!loading && !errorMsg && !items.length &&
|
||||
<EmptyTip forDialog={true}>
|
||||
<p className="text-secondary">{gettext('No share links')}</p>
|
||||
</EmptyTip>
|
||||
<EmptyTip forDialog={true} text={gettext('No share links')}/>
|
||||
}
|
||||
{!loading && !errorMsg && items.length > 0 &&
|
||||
<table className="table-hover">
|
||||
|
@@ -118,9 +118,7 @@ class RepoShareAdminUploadLinks extends Component {
|
||||
{loading && <Loading />}
|
||||
{!loading && errorMsg && <p className="error text-center mt-8">{errorMsg}</p>}
|
||||
{!loading && !errorMsg && !items.length &&
|
||||
<EmptyTip forDialog={true}>
|
||||
<p className="text-secondary">{gettext('No upload links')}</p>
|
||||
</EmptyTip>
|
||||
<EmptyTip forDialog={true} text={gettext('No upload links')}/>
|
||||
}
|
||||
{!loading && !errorMsg && items.length > 0 &&
|
||||
<table className="table-hover">
|
||||
|
@@ -175,9 +175,7 @@ class RepoShareAdminUserShares extends Component {
|
||||
{loading && <Loading />}
|
||||
{!loading && errorMsg && <p className="error text-center mt-8">{errorMsg}</p>}
|
||||
{!loading && !errorMsg && !items.length &&
|
||||
<EmptyTip forDialog={true}>
|
||||
<p className="text-secondary">{gettext('No user shares')}</p>
|
||||
</EmptyTip>
|
||||
<EmptyTip forDialog={true} text={gettext('No user shares')}/>
|
||||
}
|
||||
{!loading && !errorMsg && items.length > 0 &&
|
||||
<table className="table-hover">
|
||||
|
@@ -1,26 +1,25 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { mediaUrl } from '../utils/constants';
|
||||
import '../css/empty-tip.css';
|
||||
|
||||
const propTypes = {
|
||||
forDialog: PropTypes.bool,
|
||||
children: PropTypes.any,
|
||||
className: PropTypes.string
|
||||
};
|
||||
|
||||
class EmptyTip extends React.Component {
|
||||
|
||||
render() {
|
||||
const { className } = this.props;
|
||||
return (
|
||||
<div className={this.props.forDialog ? `${className || 'text-center mt-8'}` : 'empty-tip'}>
|
||||
<img src={`${mediaUrl}img/no-items-tip.png`} alt="" width="100" height="100" className="no-items-img-tip" />
|
||||
{this.props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function EmptyTip({ forDialog, className, title, text, children }) {
|
||||
return (
|
||||
<div className={forDialog ? `${className || 'text-center mt-8'}` : 'empty-tip'}>
|
||||
<img src={`${mediaUrl}img/no-items-tip.png`} alt="" width="100" height="100" className="no-items-img-tip" />
|
||||
{title && <span className="empty-tip-title">{title}</span>}
|
||||
{text && <span className="empty-tip-text">{text}</span>}
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
EmptyTip.propTypes = propTypes;
|
||||
EmptyTip.propTypes = {
|
||||
forDialog: PropTypes.bool,
|
||||
className: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
text: PropTypes.string,
|
||||
children: PropTypes.any,
|
||||
};
|
||||
|
||||
export default EmptyTip;
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button } from 'reactstrap';
|
||||
import { gettext, mediaUrl } from '../../utils/constants';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import SeatableAccountItem from './seatable-account-setting-item';
|
||||
import EmptyTip from '../empty-tip';
|
||||
|
||||
class SeatableAccountSettingList extends Component {
|
||||
|
||||
@@ -18,10 +19,7 @@ class SeatableAccountSettingList extends Component {
|
||||
const { seatableSettings } = this.props;
|
||||
if (!Array.isArray(seatableSettings) || seatableSettings.length === 0) {
|
||||
return (
|
||||
<div className="no-accounts d-flex flex-column align-items-center justify-content-center">
|
||||
<img src={`${mediaUrl}img/no-items-tip.png`} alt={gettext('No SeaTable bases')} />
|
||||
<p>{gettext('No SeaTable bases')}</p>
|
||||
</div>
|
||||
<EmptyTip text={gettext('No SeaTable bases')}/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
|
@@ -73,9 +73,7 @@ class LinkList extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
{shareLinks.length == 0 ? (
|
||||
<EmptyTip forDialog={true}>
|
||||
<p className="text-secondary">{gettext('No share links')}</p>
|
||||
</EmptyTip>
|
||||
<EmptyTip forDialog={true} text={gettext('No share links')}/>
|
||||
) : (
|
||||
<div className='share-list-container share-link-list'>
|
||||
<table className="table-place-header">
|
||||
|
@@ -831,8 +831,6 @@ class SharedRepoListItem extends React.Component {
|
||||
/>
|
||||
</ModalPortal>
|
||||
)}
|
||||
|
||||
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user