mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(spoiler): spoiler image wasn't showing for iframes
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -124,7 +124,6 @@ const blockquoteToGreentext = () => (tree: any) => {
|
||||
|
||||
interface MarkdownProps {
|
||||
content: string;
|
||||
spoiler?: boolean;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -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} />}
|
||||
|
||||
@@ -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} />}
|
||||
|
||||
Reference in New Issue
Block a user