mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix board logo in description
This commit is contained in:
@@ -179,7 +179,10 @@ const CommentMedia = ({ commentMediaInfo, isFloatingEmbed, post, showThumbnail,
|
|||||||
{commentMediaInfo?.type === 'image' ? (
|
{commentMediaInfo?.type === 'image' ? (
|
||||||
isMobile ? (
|
isMobile ? (
|
||||||
<span className={styles.thumbnail}>
|
<span className={styles.thumbnail}>
|
||||||
<span className={isImageExpanded ? mediaClass : `${styles.thumbnailSmall} ${thumbnailSmallPadding}`} style={isImageExpanded ? {} : thumbnailDimensions}>
|
<span
|
||||||
|
className={isImageExpanded ? mediaClass : `${isOutOfFeed ? styles.subplebbitAvatar : styles.thumbnailSmall} ${thumbnailSmallPadding}`}
|
||||||
|
style={isImageExpanded ? {} : thumbnailDimensions}
|
||||||
|
>
|
||||||
<img src={url} alt='' onClick={() => setIsImageExpanded(!isImageExpanded)} />
|
<img src={url} alt='' onClick={() => setIsImageExpanded(!isImageExpanded)} />
|
||||||
</span>
|
</span>
|
||||||
{isImageExpanded && type && (
|
{isImageExpanded && type && (
|
||||||
@@ -194,7 +197,10 @@ const CommentMedia = ({ commentMediaInfo, isFloatingEmbed, post, showThumbnail,
|
|||||||
{type && !isImageExpanded && <div className={styles.fileInfo}>{`${post?.spoiler ? `${t('spoiler')} - ` : ''} ${getDisplayMediaInfoType(type, t)}`}</div>}
|
{type && !isImageExpanded && <div className={styles.fileInfo}>{`${post?.spoiler ? `${t('spoiler')} - ` : ''} ${getDisplayMediaInfoType(type, t)}`}</div>}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<span className={isImageExpanded ? mediaClass : `${styles.thumbnailBig} ${styles.thumbnail}`} style={isImageExpanded ? {} : thumbnailDimensions}>
|
<span
|
||||||
|
className={isImageExpanded ? mediaClass : `${isOutOfFeed ? styles.subplebbitAvatar : styles.thumbnailBig} ${styles.thumbnail}`}
|
||||||
|
style={isImageExpanded ? {} : thumbnailDimensions}
|
||||||
|
>
|
||||||
<img src={url} alt='' onClick={() => setIsImageExpanded(!isImageExpanded)} />
|
<img src={url} alt='' onClick={() => setIsImageExpanded(!isImageExpanded)} />
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -227,6 +227,7 @@ const PostMedia = ({ post }: PostProps) => {
|
|||||||
const PostMediaContent = ({ post, link, spoiler, t }: { post: any; link: string; spoiler: boolean; t: any }) => {
|
const PostMediaContent = ({ post, link, spoiler, t }: { post: any; link: string; spoiler: boolean; t: any }) => {
|
||||||
const initialInfo = getCommentMediaInfo(post);
|
const initialInfo = getCommentMediaInfo(post);
|
||||||
const [webpageThumbnail, setWebpageThumbnail] = useState<CommentMediaInfo | undefined>();
|
const [webpageThumbnail, setWebpageThumbnail] = useState<CommentMediaInfo | undefined>();
|
||||||
|
const { isDescription, isRules } = post || {}; // custom properties, not from api
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false
|
// some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false
|
||||||
@@ -289,7 +290,13 @@ const PostMediaContent = ({ post, link, spoiler, t }: { post: any; link: string;
|
|||||||
</div>
|
</div>
|
||||||
{(hasThumbnail || (!hasThumbnail && !showThumbnail) || spoiler) && (
|
{(hasThumbnail || (!hasThumbnail && !showThumbnail) || spoiler) && (
|
||||||
<div className={styles.fileThumbnail}>
|
<div className={styles.fileThumbnail}>
|
||||||
<CommentMedia commentMediaInfo={commentMediaInfo} post={post} showThumbnail={showThumbnail} setShowThumbnail={setShowThumbnail} />
|
<CommentMedia
|
||||||
|
commentMediaInfo={commentMediaInfo}
|
||||||
|
post={post}
|
||||||
|
showThumbnail={showThumbnail}
|
||||||
|
setShowThumbnail={setShowThumbnail}
|
||||||
|
isOutOfFeed={isDescription || isRules}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ const PostMediaContent = ({ post, link, t }: { post: any; link: string; t: any }
|
|||||||
const initialInfo = getCommentMediaInfo(post);
|
const initialInfo = getCommentMediaInfo(post);
|
||||||
const [webpageThumbnail, setWebpageThumbnail] = useState<CommentMediaInfo | undefined>();
|
const [webpageThumbnail, setWebpageThumbnail] = useState<CommentMediaInfo | undefined>();
|
||||||
const [showThumbnail, setShowThumbnail] = useState(true);
|
const [showThumbnail, setShowThumbnail] = useState(true);
|
||||||
|
const { isDescription, isRules } = post || {}; // custom properties, not from api
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false
|
// some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false
|
||||||
const loadThumbnail = async () => {
|
const loadThumbnail = async () => {
|
||||||
@@ -210,7 +210,17 @@ const PostMediaContent = ({ post, link, t }: { post: any; link: string; t: any }
|
|||||||
const commentMediaInfo = webpageThumbnail || initialInfo;
|
const commentMediaInfo = webpageThumbnail || initialInfo;
|
||||||
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
||||||
|
|
||||||
return hasThumbnail && <CommentMedia commentMediaInfo={commentMediaInfo} post={post} showThumbnail={showThumbnail} setShowThumbnail={setShowThumbnail} />;
|
return (
|
||||||
|
hasThumbnail && (
|
||||||
|
<CommentMedia
|
||||||
|
commentMediaInfo={commentMediaInfo}
|
||||||
|
post={post}
|
||||||
|
showThumbnail={showThumbnail}
|
||||||
|
setShowThumbnail={setShowThumbnail}
|
||||||
|
isOutOfFeed={isDescription || isRules}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ReplyBacklinks = ({ post }: PostProps) => {
|
const ReplyBacklinks = ({ post }: PostProps) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user