Uploads: show placeholder when loading
This commit is contained in:
parent
2a38f2c177
commit
1e6f64f235
1 changed files with 5 additions and 2 deletions
|
@ -4,6 +4,7 @@ import * as ICONS from 'constants/icons';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import ClaimList from 'component/claimList';
|
import ClaimList from 'component/claimList';
|
||||||
|
import ClaimPreview from 'component/claimPreview';
|
||||||
import Page from 'component/page';
|
import Page from 'component/page';
|
||||||
import Paginate from 'component/common/paginate';
|
import Paginate from 'component/common/paginate';
|
||||||
import { PAGE_PARAM, PAGE_SIZE_PARAM } from 'constants/claim';
|
import { PAGE_PARAM, PAGE_SIZE_PARAM } from 'constants/claim';
|
||||||
|
@ -106,7 +107,6 @@ function FileListPublished(props: Props) {
|
||||||
}
|
}
|
||||||
headerAltControls={
|
headerAltControls={
|
||||||
<div className="card__actions--inline">
|
<div className="card__actions--inline">
|
||||||
{fetching && <Spinner type="small" />}
|
|
||||||
{!fetching && (
|
{!fetching && (
|
||||||
<Button
|
<Button
|
||||||
button="alt"
|
button="alt"
|
||||||
|
@ -125,8 +125,11 @@ function FileListPublished(props: Props) {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
persistedStorageKey="claim-list-published"
|
persistedStorageKey="claim-list-published"
|
||||||
uris={urls}
|
uris={fetching ? [] : urls}
|
||||||
|
loading={fetching}
|
||||||
/>
|
/>
|
||||||
|
{fetching &&
|
||||||
|
new Array(Number(pageSize)).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
|
||||||
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
|
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in a new issue