mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
render tumbnail fallback wrapped in memo
This commit is contained in:
parent
9ed33c2eb4
commit
ffa82b6257
1 changed files with 4 additions and 6 deletions
|
|
@ -7,6 +7,9 @@ const StreamPlaceholder = require('./StreamPlaceholder');
|
|||
const styles = require('./styles');
|
||||
|
||||
const Stream = ({ className, addonName, title, thumbnail, progress, ...props }) => {
|
||||
const renderThumbnailFallback = React.useMemo(() => () => (
|
||||
<Icon className={styles['placeholder-icon']} icon={'ic_broken_link'} />
|
||||
), []);
|
||||
return (
|
||||
<Button {...props} className={classnames(className, styles['stream-container'])} title={title}>
|
||||
{
|
||||
|
|
@ -16,12 +19,7 @@ const Stream = ({ className, addonName, title, thumbnail, progress, ...props })
|
|||
className={styles['thumbnail']}
|
||||
src={thumbnail}
|
||||
alt={' '}
|
||||
renderFallback={() => (
|
||||
<Icon
|
||||
className={styles['placeholder-icon']}
|
||||
icon={'ic_broken_link'}
|
||||
/>
|
||||
)}
|
||||
renderFallback={renderThumbnailFallback}
|
||||
/>
|
||||
</div>
|
||||
:
|
||||
|
|
|
|||
Loading…
Reference in a new issue