diff --git a/src/components/views/Home.jsx b/src/components/views/Home.jsx index 6fb56182..06096473 100644 --- a/src/components/views/Home.jsx +++ b/src/components/views/Home.jsx @@ -13,50 +13,59 @@ import { Tooltip } from 'react-tooltip'; const { version } = packageJson; const commitRef = process?.env?.REACT_APP_COMMIT_REF ? ` ${process.env.REACT_APP_COMMIT_REF.slice(0, 7)}` : ''; -const SubplebbitTitle = ({ address }) => { - const subplebbitAddress = address; - const subplebbit = useSubplebbit({ subplebbitAddress }); - const title = subplebbit.title ?? null; - - return <>{title ? {title} : }>; -}; - const RecentThread = ({ commentCid }) => { const comment = useComment({ commentCid }); const subplebbit = useSubplebbit({ subplebbitAddress: comment?.subplebbitAddress }); const { setSelectedAddress, setSelectedTitle } = useGeneralStore((state) => state); const commentMediaInfo = getCommentMediaInfo(comment); + const isMediaShowed = + comment.link && + commentMediaInfo && + (commentMediaInfo.type === 'image' || + commentMediaInfo.type === 'video' || + (commentMediaInfo.type === 'webpage' && commentMediaInfo.thumbnail) || + (commentMediaInfo.type === 'iframe' && commentMediaInfo.thumbnail)) + ? true + : false; return ( -