Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit ca027ab

Browse files
committed
[ux]: render proper images; thumbnail as fallback only;
1 parent e95d891 commit ca027ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/component/reddit/RedditPostRenderer.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ interface RedditPost {
3535
score: number;
3636
selftext?: string;
3737
created_utc: number;
38+
url_overridden_by_dest?: string;
3839
}
3940

4041
interface RedditComment {
@@ -90,9 +91,18 @@ const RedditListing: React.FC<RedditListingProps> = ({ data }) => {
9091
style={{ marginBottom: 24 }}
9192
>
9293
<Space direction="vertical" size="middle" style={{ width: '100%' }}>
93-
{d.thumbnail && d.thumbnail.startsWith('http') && (
94+
{d.url_overridden_by_dest === undefined && d.thumbnail && d.thumbnail.startsWith('http') && (
9495
<Image width={200} src={d.thumbnail} alt="thumbnail" />
9596
)}
97+
<div style={{ display: 'flex', justifyContent: 'center' }}>
98+
{d.url_overridden_by_dest && d.url_overridden_by_dest.startsWith('http') && (
99+
<Image
100+
width={200}
101+
src={d.url_overridden_by_dest}
102+
alt={d.url_overridden_by_dest}
103+
/>
104+
)}
105+
</div>
96106
<Descriptions column={1} bordered size="small">
97107
<Descriptions.Item label="Subreddit">
98108
{d.subreddit_name_prefixed}

0 commit comments

Comments
 (0)