perf(feed post): fix img source impacted scroll performance

This commit is contained in:
plebeius.eth
2023-10-15 22:10:19 +02:00
parent ede81ceba6
commit a7fd5dd36b

View File

@@ -63,7 +63,8 @@ const FeedPost: FC<FeedPostProps> = ({ post, index }) => {
{commentMediaInfo?.type === 'video' &&
(commentMediaInfo.thumbnail ? <img src={commentMediaInfo.thumbnail} alt='thumbnail' /> : <video src={commentMediaInfo.url} />)}
{commentMediaInfo?.type === 'webpage' && commentMediaInfo.thumbnail && <img src={commentMediaInfo.thumbnail} alt='thumbnail' />}
{commentMediaInfo?.type === 'iframe' && <img src={commentMediaInfo.scrapedThumbnailUrl || commentMediaInfo.thumbnail} alt='thumbnail' />}
{commentMediaInfo?.type === 'iframe' && commentMediaInfo.thumbnail && <img src={commentMediaInfo.thumbnail} alt='thumbnail' />}
{commentMediaInfo?.type === 'iframe' && commentMediaInfo.scrapedThumbnailUrl && <img src={commentMediaInfo.scrapedThumbnailUrl} alt='thumbnail' />}
</Link>
</span>
)}