move fetching logic to page component

This commit is contained in:
Travis Eden 2018-06-19 14:22:13 -04:00 committed by Sean Yesmunt
parent e5f6acc5ae
commit 49700d5906
2 changed files with 5 additions and 9 deletions

View file

@ -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">

View file

@ -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">