mirror of
https://github.com/eyebluecn/tank-front
synced 2024-04-21 12:31:55 +00:00
Fix the share empty hint.
This commit is contained in:
@@ -238,6 +238,7 @@ let LangEn = {
|
||||
month: "1 Month",
|
||||
year: "1 Year",
|
||||
infinity: "Forever",
|
||||
emptyHint: "No Share Yet",
|
||||
},
|
||||
user: {
|
||||
redirecting: "Redirecting...",
|
||||
|
||||
@@ -239,6 +239,7 @@ let LangZh = {
|
||||
month: "1个月",
|
||||
year: "1年",
|
||||
infinity: "永远有效",
|
||||
emptyHint: "暂无任何分享",
|
||||
},
|
||||
user: {
|
||||
redirecting: "正在转跳...",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { RouteComponentProps } from "react-router-dom";
|
||||
import { Pagination } from "antd";
|
||||
import {RouteComponentProps} from "react-router-dom";
|
||||
import {Empty, Pagination} from "antd";
|
||||
import TankTitle from "../widget/TankTitle";
|
||||
import TankComponent from "../../common/component/TankComponent";
|
||||
import Pager from "../../common/model/base/Pager";
|
||||
@@ -10,9 +10,11 @@ import ShareBar from "./widget/ShareBar";
|
||||
import "./List.less";
|
||||
import Lang from "../../common/model/global/Lang";
|
||||
|
||||
interface IProps extends RouteComponentProps {}
|
||||
interface IProps extends RouteComponentProps {
|
||||
}
|
||||
|
||||
interface IState {}
|
||||
interface IState {
|
||||
}
|
||||
|
||||
export default class List extends TankComponent<IProps, IState> {
|
||||
pager = new Pager<Share>(this, Share, Pager.MAX_PAGE_SIZE);
|
||||
@@ -37,14 +39,14 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { pager } = this;
|
||||
const {pager} = this;
|
||||
|
||||
return (
|
||||
<div className="share-list">
|
||||
<TankTitle name={Lang.t("layout.myShare")} />
|
||||
<TankTitle name={Lang.t("layout.myShare")}/>
|
||||
|
||||
{pager.data.map((share) => (
|
||||
<ShareBar key={share.uuid!} share={share} onDeleteSuccess={this.refresh} />
|
||||
<ShareBar key={share.uuid!} share={share} onDeleteSuccess={this.refresh}/>
|
||||
))}
|
||||
|
||||
<Pagination
|
||||
@@ -55,6 +57,11 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
pageSize={pager.pageSize}
|
||||
hideOnSinglePage
|
||||
/>
|
||||
|
||||
{pager.isEmpty() && (
|
||||
<Empty description={Lang.t("share.emptyHint")}/>
|
||||
)}
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user