move fetching logic to page component
This commit is contained in:
parent
e5f6acc5ae
commit
49700d5906
2 changed files with 5 additions and 9 deletions
|
@ -13,13 +13,11 @@ type Props = {
|
||||||
class FileListDownloaded extends React.PureComponent<Props> {
|
class FileListDownloaded extends React.PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { fetching, fileInfos, navigate } = this.props;
|
const { fetching, fileInfos, navigate } = this.props;
|
||||||
const hasDownloads = fileInfos && fileInfos.length > 0;
|
const hasDownloads = fileInfos && Object.values(fileInfos).length > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page notContained>
|
<Page notContained loading={fetching}>
|
||||||
{fetching ? (
|
{hasDownloads ? (
|
||||||
<div className="card__actions card__actions--center">Fetching content...</div>
|
|
||||||
) : hasDownloads ? (
|
|
||||||
<FileList fileInfos={fileInfos} />
|
<FileList fileInfos={fileInfos} />
|
||||||
) : (
|
) : (
|
||||||
<div className="page__empty">
|
<div className="page__empty">
|
||||||
|
|
|
@ -24,10 +24,8 @@ class FileListPublished extends React.PureComponent<Props> {
|
||||||
const { fetching, claims, navigate } = this.props;
|
const { fetching, claims, navigate } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page notContained>
|
<Page notContained loading={fetching}>
|
||||||
{fetching ? (
|
{claims && claims.length ? (
|
||||||
<div className="card__actions card__actions--center">Fetching content...</div>
|
|
||||||
) : claims.length ? (
|
|
||||||
<FileList checkPending fileInfos={claims} sortByHeight />
|
<FileList checkPending fileInfos={claims} sortByHeight />
|
||||||
) : (
|
) : (
|
||||||
<div className="page__empty">
|
<div className="page__empty">
|
||||||
|
|
Loading…
Reference in a new issue