fix: tooltip shows properly if not in progress (#3185)

pull/3186/head
Brandon Cohen 2 years ago committed by GitHub
parent 27feeea691
commit 6face8cc45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -96,7 +96,7 @@ const StatusBadge = ({
} }
} }
const tooltipContent = downloadItem ? ( const tooltipContent = (
<ul> <ul>
{downloadItem.map((status, index) => ( {downloadItem.map((status, index) => (
<li <li
@ -111,8 +111,6 @@ const StatusBadge = ({
</li> </li>
))} ))}
</ul> </ul>
) : (
mediaLinkDescription
); );
const badgeDownloadProgress = ( const badgeDownloadProgress = (
@ -134,11 +132,13 @@ const StatusBadge = ({
case MediaStatus.AVAILABLE: case MediaStatus.AVAILABLE:
return ( return (
<Tooltip <Tooltip
content={inProgress && tooltipContent} content={inProgress ? tooltipContent : mediaLinkDescription}
className={`${ className={`${
inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block' inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block'
}`} }`}
tooltipConfig={{ interactive: true, delayHide: 100 }} tooltipConfig={{
...(inProgress && { interactive: true, delayHide: 100 }),
}}
> >
<Badge <Badge
badgeType="success" badgeType="success"
@ -185,11 +185,13 @@ const StatusBadge = ({
case MediaStatus.PARTIALLY_AVAILABLE: case MediaStatus.PARTIALLY_AVAILABLE:
return ( return (
<Tooltip <Tooltip
content={inProgress && tooltipContent} content={inProgress ? tooltipContent : mediaLinkDescription}
className={`${ className={`${
inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block' inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block'
}`} }`}
tooltipConfig={{ interactive: true, delayHide: 100 }} tooltipConfig={{
...(inProgress && { interactive: true, delayHide: 100 }),
}}
> >
<Badge <Badge
badgeType="success" badgeType="success"
@ -236,18 +238,20 @@ const StatusBadge = ({
case MediaStatus.PROCESSING: case MediaStatus.PROCESSING:
return ( return (
<Tooltip <Tooltip
content={inProgress && tooltipContent} content={inProgress ? tooltipContent : mediaLinkDescription}
className={`${ className={`${
inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block' inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block'
}`} }`}
tooltipConfig={{ interactive: true, delayHide: 100 }} tooltipConfig={{
...(inProgress && { interactive: true, delayHide: 100 }),
}}
> >
<Badge <Badge
badgeType="primary" badgeType="primary"
href={mediaLink} href={mediaLink}
className={`${ className={`${
inProgress && inProgress &&
'relative !bg-gray-700 !bg-opacity-80 !px-0 hover:!bg-gray-700' 'relative !bg-gray-700 !bg-opacity-80 !px-0 hover:overflow-hidden hover:!bg-gray-700'
} overflow-hidden`} } overflow-hidden`}
> >
{inProgress && badgeDownloadProgress} {inProgress && badgeDownloadProgress}

Loading…
Cancel
Save