This commit is contained in:
saplf
2019-09-08 21:48:48 +08:00
parent e493267a51
commit 9aa5d0d5bf
12 changed files with 88 additions and 32 deletions

View File

@@ -75,6 +75,25 @@ const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
</div>
);
let body;
if (data) {
if (data.length) {
body = data.map(renderItem);
} else {
body = (
<div className={styles.message}>
{formatMessage({ id: 'home.mine.none' })}
</div>
);
}
} else {
body = (
<div className={styles.message}>
{formatMessage({ id: errorList ? 'common.loadError' : 'common.loading' })}
</div>
);
}
return (
<div className={styles.container}>
{renderBanner}
@@ -87,11 +106,7 @@ const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
</div>
<Spin className={styles.list} spinning={refreshingList}>
{!data ? (
<div className={styles.message}>
{formatMessage({ id: errorList ? 'common.loadError' : 'common.loading' })}
</div>
) : data.map(renderItem)}
{body}
</Spin>
</div>
);