add spinner to web upload message and fix double card issue

This commit is contained in:
Sean Yesmunt 2020-09-16 16:12:47 -04:00
parent 23f218a568
commit 6b8a38b894
4 changed files with 45 additions and 45 deletions

View file

@ -3,6 +3,7 @@
import React from 'react'; import React from 'react';
import Lbry from 'lbry-redux'; import Lbry from 'lbry-redux';
import Button from 'component/button'; import Button from 'component/button';
import Spinner from 'component/spinner';
type Props = { type Props = {
reflectingInfo?: ReflectingUpdate, reflectingInfo?: ReflectingUpdate,
@ -25,7 +26,11 @@ const PublishPending = (props: Props) => {
} else if (reflecting) { } else if (reflecting) {
return <span>{__('Uploading (%progress%%) ', { progress: progress })}</span>; return <span>{__('Uploading (%progress%%) ', { progress: progress })}</span>;
} else { } else {
return <span>{__('Confirming')}</span>; return (
<span>
{__('Confirming...')} <Spinner type="small" />
</span>
);
} }
}; };

View file

@ -6,7 +6,6 @@ import Page from 'component/page';
import Button from 'component/button'; import Button from 'component/button';
import YoutubeTransferStatus from 'component/youtubeTransferStatus'; import YoutubeTransferStatus from 'component/youtubeTransferStatus';
import Spinner from 'component/spinner'; import Spinner from 'component/spinner';
import Card from 'component/common/card';
import Yrbl from 'component/yrbl'; import Yrbl from 'component/yrbl';
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
@ -33,20 +32,18 @@ export default function ChannelsPage(props: Props) {
{hasYoutubeChannels && <YoutubeTransferStatus hideChannelLink />} {hasYoutubeChannels && <YoutubeTransferStatus hideChannelLink />}
{channelUrls && Boolean(channelUrls.length) && ( {channelUrls && Boolean(channelUrls.length) && (
<Card <ClaimList
title={__('Your channels')} header={<h1 className="section__title">{__('Your channels')}</h1>}
titleActions={ headerAltControls={
<> <Button
<Button button="secondary"
button="secondary" icon={ICONS.CHANNEL}
icon={ICONS.CHANNEL} label={__('New Channel')}
label={__('New Channel')} navigate={`/$/${PAGES.CHANNEL_NEW}`}
navigate={`/$/${PAGES.CHANNEL_NEW}`} />
/>
</>
} }
isBodyList loading={fetchingChannels}
body={<ClaimList loading={fetchingChannels} uris={channelUrls} />} uris={channelUrls}
/> />
)} )}
</div> </div>

View file

@ -9,7 +9,6 @@ import Paginate from 'component/common/paginate';
import { PAGE_PARAM, PAGE_SIZE_PARAM } from 'constants/claim'; import { PAGE_PARAM, PAGE_SIZE_PARAM } from 'constants/claim';
import WebUploadList from 'component/webUploadList'; import WebUploadList from 'component/webUploadList';
import Spinner from 'component/spinner'; import Spinner from 'component/spinner';
import Card from 'component/common/card';
import Yrbl from 'component/yrbl'; import Yrbl from 'component/yrbl';
type Props = { type Props = {
@ -61,36 +60,35 @@ function FileListPublished(props: Props) {
<div className="card-stack"> <div className="card-stack">
<WebUploadList /> <WebUploadList />
{!!(urls && urls.length) && ( {!!(urls && urls.length) && (
<Card <>
title={__('Uploads')} <ClaimList
titleActions={ header={<h1 className="section__title">{__('Uploads')}</h1>}
<div className="card__actions--inline"> headerAltControls={
{fetching && <Spinner type="small" />} <div className="card__actions--inline">
{!fetching && ( {fetching && <Spinner type="small" />}
{!fetching && (
<Button
button="alt"
label={__('Refresh')}
icon={ICONS.REFRESH}
onClick={() => fetchClaimListMine(params.page, params.page_size)}
/>
)}
<Button <Button
button="alt" icon={ICONS.PUBLISH}
label={__('Refresh')} button="secondary"
icon={ICONS.REFRESH} label={__('Upload')}
onClick={() => fetchClaimListMine(params.page, params.page_size)} navigate={`/$/${PAGES.UPLOAD}`}
onClick={() => clearPublish()}
/> />
)} </div>
<Button }
icon={ICONS.PUBLISH} loading={fetching}
button="secondary" persistedStorageKey="claim-list-published"
label={__('Upload')} uris={urls}
navigate={`/$/${PAGES.UPLOAD}`} />
onClick={() => clearPublish()} <Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
/> </>
</div>
}
isBodyList
body={
<div>
<ClaimList loading={fetching} persistedStorageKey="claim-list-published" uris={urls} />
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
</div>
}
/>
)} )}
</div> </div>
{!(urls && urls.length) && ( {!(urls && urls.length) && (

View file

@ -51,7 +51,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: auto; margin-left: auto;
padding-top: var(--spacing-m); // padding-top: var(--spacing-m);
& > * { & > * {
margin-left: var(--spacing-s); margin-left: var(--spacing-s);