fix(spoiler): spoiler image wasn't showing for iframes

This commit is contained in:
Tom (plebeius.eth)
2024-07-04 21:38:01 +02:00
parent 8d766cc9e3
commit 85aeb86047
4 changed files with 6 additions and 9 deletions
+1 -3
View File
@@ -188,9 +188,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
});
const postContent = (
<div className={`${styles.teaser} ${hidden && styles.hidden}`}>
{hidden ? <b>({t('hidden')})</b> : <Markdown title={title} content={content} spoiler={spoiler} />}
</div>
<div className={`${styles.teaser} ${hidden && styles.hidden}`}>{hidden ? <b>({t('hidden')})</b> : <Markdown title={title} content={content} />}</div>
);
const { imageSize, showOPComment } = useCatalogStyleStore();
-1
View File
@@ -124,7 +124,6 @@ const blockquoteToGreentext = () => (tree: any) => {
interface MarkdownProps {
content: string;
spoiler?: boolean;
title?: string;
}
+3 -3
View File
@@ -207,7 +207,7 @@ const PostMedia = ({ post }: PostProps) => {
</span>
)}
</div>
{(hasThumbnail || (!hasThumbnail && !showThumbnail)) && (
{(hasThumbnail || (!hasThumbnail && !showThumbnail) || spoiler) && (
<div className={styles.fileThumbnail}>
<CommentMedia commentMediaInfo={commentMediaInfo} post={post} showThumbnail={showThumbnail} setShowThumbnail={setShowThumbnail} />
</div>
@@ -217,7 +217,7 @@ const PostMedia = ({ post }: PostProps) => {
};
const PostMessage = ({ post }: PostProps) => {
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {};
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, state, subplebbitAddress } = post || {};
// TODO: commentAuthor is not available outside of editedComment, update when available
// const banned = !!post?.commentAuthor?.banExpiresAt;
const { t } = useTranslation();
@@ -252,7 +252,7 @@ const PostMessage = ({ post }: PostProps) => {
<Tooltip children={<span className={styles.deletedContent}>{t('user_deleted_this_post')}</span>} content={reason && `${t('reason')}: ${reason}`} />
) : (
<>
{!showOriginal && <Markdown content={displayContent} spoiler={spoiler} />}
{!showOriginal && <Markdown content={displayContent} />}
{edit && original?.content !== post?.content && (
<span className={styles.editedInfo}>
{showOriginal && <Markdown content={original?.content} />}
+2 -2
View File
@@ -152,7 +152,7 @@ const ReplyBacklinks = ({ post }: PostProps) => {
const PostMessageMobile = ({ post }: PostProps) => {
const { t } = useTranslation();
const { cid, commentAuthor, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {};
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, state, subplebbitAddress } = post || {};
// TODO: commentAuthor is not available outside of editedComment, update when available
// const banned = !!post?.commentAuthor?.banExpiresAt;
const [showOriginal, setShowOriginal] = useState(false);
@@ -188,7 +188,7 @@ const PostMessageMobile = ({ post }: PostProps) => {
<Tooltip children={<span className={styles.deletedContent}>{t('user_deleted_this_post')}</span>} content={reason && `${t('reason')}: ${reason}`} />
) : (
<>
{!showOriginal && <Markdown content={displayContent} spoiler={spoiler} />}
{!showOriginal && <Markdown content={displayContent} />}
{edit && original?.content !== post?.content && (
<span className={styles.editedInfo}>
{showOriginal && <Markdown content={original?.content} />}