diff --git a/src/common/MetaPreview/MetaPreview.js b/src/common/MetaPreview/MetaPreview.js index a9424b8fd..e6c042c40 100644 --- a/src/common/MetaPreview/MetaPreview.js +++ b/src/common/MetaPreview/MetaPreview.js @@ -92,9 +92,16 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele return trailerStreams[0].deepLinks.player; }, [trailerStreams]); - const renderLogoFallback = React.useCallback(() => ( - - ), []); + const logoFallback = ({ currentTarget }) => { + currentTarget.onerror = null; // detach handler + if (compact) { + // replace with blank png + currentTarget.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='; + } else { + // show img.alt without broken image icon + currentTarget.className = styles['missing']; + } + } return (
{ @@ -106,17 +113,14 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele null }
- { - typeof logo === 'string' && logo.length > 0 ? - {' - : - null - } +
+ {name} +
{ (typeof releaseInfo === 'string' && releaseInfo.length > 0) || (released instanceof Date && !isNaN(released.getTime())) || (typeof runtime === 'string' && runtime.length > 0) || linksGroups.has(CONSTANTS.IMDB_LINK_CATEGORY) ?
@@ -155,7 +159,7 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele null } { - typeof name === 'string' && name.length > 0 ? + compact && typeof name === 'string' && name.length > 0 ?
{name}
@@ -163,7 +167,7 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele null } { - typeof description === 'string' && description.length > 0 ? + compact && typeof description === 'string' && description.length > 0 ?
{description}
: null @@ -172,7 +176,8 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele Array.from(linksGroups.keys()) .filter((category) => { return category !== CONSTANTS.IMDB_LINK_CATEGORY && - category !== CONSTANTS.SHARE_LINK_CATEGORY; + category !== CONSTANTS.SHARE_LINK_CATEGORY && + category !== 'Writers'; }) .map((category, index) => (