Revert "Remove the delayed thumbnail message for ChannelEdit"

This reverts commit a7e571c3b9.
This commit is contained in:
infinite-persistence 2021-12-16 16:16:16 +08:00
parent f5cce18a55
commit 7d9e8bffae
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
2 changed files with 23 additions and 13 deletions

View file

@ -322,6 +322,7 @@ function ChannelForm(props: Props) {
uri={uri}
thumbnailPreview={thumbnailPreview}
allowGifs
showDelayedMessage={isUpload.thumbnail}
setThumbUploadError={setThumbError}
thumbUploadError={thumbError}
/>

View file

@ -20,8 +20,10 @@ type Props = {
claim: ?ChannelClaim,
doResolveUri: (string) => void,
isResolving: boolean,
showDelayedMessage?: boolean,
noLazyLoad?: boolean,
hideStakedIndicator?: boolean,
xsmall?: boolean,
noOptimization?: boolean,
setThumbUploadError: (boolean) => void,
ThumbUploadError: boolean,
@ -40,6 +42,7 @@ function ChannelThumbnail(props: Props) {
claim,
doResolveUri,
isResolving,
showDelayedMessage = false,
noLazyLoad,
hideStakedIndicator = false,
setThumbUploadError,
@ -88,19 +91,25 @@ function ChannelThumbnail(props: Props) {
'channel-thumbnail--resolving': isResolving,
})}
>
<OptimizedImage
alt={__('Channel profile picture')}
className={!channelThumbnail ? 'channel-thumbnail__default' : 'channel-thumbnail__custom'}
src={(!thumbLoadError && channelThumbnail) || defaultAvatar}
loading={noLazyLoad ? undefined : 'lazy'}
onError={() => {
if (setThumbUploadError) {
setThumbUploadError(true);
} else {
setThumbLoadError(true);
}
}}
/>
{showDelayedMessage ? (
<div className="channel-thumbnail--waiting">
{__('This will be visible in a few minutes after you submit this form.')}
</div>
) : (
<OptimizedImage
alt={__('Channel profile picture')}
className={!channelThumbnail ? 'channel-thumbnail__default' : 'channel-thumbnail__custom'}
src={(!thumbLoadError && channelThumbnail) || defaultAvatar}
loading={noLazyLoad ? undefined : 'lazy'}
onError={() => {
if (setThumbUploadError) {
setThumbUploadError(true);
} else {
setThumbLoadError(true);
}
}}
/>
)}
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
</div>
);