diff --git a/ui/component/common/markdown-preview.jsx b/ui/component/common/markdown-preview.jsx index 59cc21ee5..c97069f0e 100644 --- a/ui/component/common/markdown-preview.jsx +++ b/ui/component/common/markdown-preview.jsx @@ -1,8 +1,9 @@ // @flow -import { CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS, SIMPLE_SITE } from 'config'; +import { CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS, MISSING_THUMB_DEFAULT } from 'config'; import { formattedEmote, inlineEmote } from 'util/remark-emote'; import { formattedLinks, inlineLinks } from 'util/remark-lbry'; import { formattedTimestamp, inlineTimestamp } from 'util/remark-timestamp'; +import { getThumbnailCdnUrl } from 'util/thumbnail'; import * as ICONS from 'constants/icons'; import * as React from 'react'; import Button from 'component/button'; @@ -194,17 +195,22 @@ export default React.memo(function MarkdownPreview(props: Markdow ), // Workaraund of remarkOptions.Fragment div: React.Fragment, - img: (imgProps) => - isStakeEnoughForPreview(stakedLevel) && !isEmote(imgProps.title, imgProps.src) ? ( - - ) : ( - - ), + img: (imgProps) => { + const imageCdnUrl = + getThumbnailCdnUrl({ thumbnail: imgProps.src, width: 0, height: 0, quality: 85 }) || MISSING_THUMB_DEFAULT; + if (isStakeEnoughForPreview(stakedLevel) && !isEmote(imgProps.title, imgProps.src)) { + return ; + } else { + return ( + + ); + } + }, }, };