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> {
|
||||
render() {
|
||||
const { fetching, fileInfos, navigate } = this.props;
|
||||
const hasDownloads = fileInfos && fileInfos.length > 0;
|
||||
const hasDownloads = fileInfos && Object.values(fileInfos).length > 0;
|
||||
|
||||
return (
|
||||
<Page notContained>
|
||||
{fetching ? (
|
||||
<div className="card__actions card__actions--center">Fetching content...</div>
|
||||
) : hasDownloads ? (
|
||||
<Page notContained loading={fetching}>
|
||||
{hasDownloads ? (
|
||||
<FileList fileInfos={fileInfos} />
|
||||
) : (
|
||||
<div className="page__empty">
|
||||
|
|
|
@ -24,10 +24,8 @@ class FileListPublished extends React.PureComponent<Props> {
|
|||
const { fetching, claims, navigate } = this.props;
|
||||
|
||||
return (
|
||||
<Page notContained>
|
||||
{fetching ? (
|
||||
<div className="card__actions card__actions--center">Fetching content...</div>
|
||||
) : claims.length ? (
|
||||
<Page notContained loading={fetching}>
|
||||
{claims && claims.length ? (
|
||||
<FileList checkPending fileInfos={claims} sortByHeight />
|
||||
) : (
|
||||
<div className="page__empty">
|
||||
|
|
Loading…
Reference in a new issue