deal with completed transfers on youtube transfer page

This commit is contained in:
Sean Yesmunt 2020-12-11 15:25:01 -05:00
parent 38a916dcc4
commit 9c5ffdc1bf
2 changed files with 28 additions and 7 deletions

View file

@ -90,13 +90,24 @@ export default function YoutubeTransferStatus(props: Props) {
return ( return (
(alwaysShow || (hasChannels && !isYoutubeTransferComplete)) && ( (alwaysShow || (hasChannels && !isYoutubeTransferComplete)) && (
<Card <Card
title={youtubeChannels.length > 1 ? __('Your YouTube channels') : __('Your YouTube channel')} title={
isYoutubeTransferComplete
? __('Transfer Complete')
: youtubeChannels.length > 1
? __('Your YouTube channels')
: __('Your YouTube channel')
}
subtitle={ subtitle={
<span> <span>
{hasPendingTransfers && {hasPendingTransfers &&
__('Your videos are currently being transferred. There is nothing else for you to do.')} __('Your videos are currently being transferred. There is nothing else for you to do.')}
{transferEnabled && !hasPendingTransfers && __('Your videos are ready to be transferred.')} {transferEnabled && !hasPendingTransfers && __('Your videos are ready to be transferred.')}
{!transferEnabled && !hasPendingTransfers && __('Please check back later. This may take up to 1 week.')} {!transferEnabled &&
!hasPendingTransfers &&
!isYoutubeTransferComplete &&
__('Please check back later. This may take up to 1 week.')}
{isYoutubeTransferComplete && __('View your channel or choose a new channel to sync.')}
</span> </span>
} }
body={ body={
@ -173,13 +184,19 @@ export default function YoutubeTransferStatus(props: Props) {
actions={ actions={
<> <>
<div className="section__actions"> <div className="section__actions">
{!isYoutubeTransferComplete && (
<Button <Button
button="primary" button="primary"
disabled={youtubeImportPending || !transferEnabled} disabled={youtubeImportPending || !transferEnabled}
onClick={claimChannels} onClick={claimChannels}
label={youtubeChannels.length > 1 ? __('Claim Channels') : __('Claim Channel')} label={youtubeChannels.length > 1 ? __('Claim Channels') : __('Claim Channel')}
/> />
<Button button="link" label={__('Explore %SITE_NAME%', { SITE_NAME })} navigate="/" /> )}
<Button
button={isYoutubeTransferComplete ? 'primary' : 'link'}
label={__('Explore %SITE_NAME%', { SITE_NAME })}
navigate="/"
/>
</div> </div>
<p className="help"> <p className="help">

View file

@ -223,6 +223,10 @@ textarea {
&:not(:last-child) { &:not(:last-child) {
margin-bottom: var(--spacing-s); margin-bottom: var(--spacing-s);
} }
.button--link ~ .button--link {
margin-left: var(--spacing-s);
}
} }
.help--warning { .help--warning {