Fix the share empty hint.

This commit is contained in:
lishuang
2020-07-12 21:49:49 +08:00
parent e003175a02
commit 4bcc3555ca
3 changed files with 16 additions and 7 deletions
+1
View File
@@ -238,6 +238,7 @@ let LangEn = {
month: "1 Month",
year: "1 Year",
infinity: "Forever",
emptyHint: "No Share Yet",
},
user: {
redirecting: "Redirecting...",
+1
View File
@@ -239,6 +239,7 @@ let LangZh = {
month: "1个月",
year: "1年",
infinity: "永远有效",
emptyHint: "暂无任何分享",
},
user: {
redirecting: "正在转跳...",
+14 -7
View File
@@ -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>
);
}