fix: show post.url if the post does not have a thumbnail (#23)
Right now, if a post does not have a post.thumbnail_url and is just a link to another website, the link is not displayed... so the user cannot go to the actual article. This copies the link code from the Post object and provides a link if there is a post.url but not a post.thumbnail_url.
This commit is contained in:
1 parent
e028113ab0
commit
e778450963
1 file changed
+8
-1
@@ -92,7 +92,14 @@
|
|||||||
saved={postData.saved}
|
saved={postData.saved}
|
||||||
/>
|
/>
|
||||||
<h1 class="font-bold text-lg">{post.name}</h1>
|
<h1 class="font-bold text-lg">{post.name}</h1>
|
||||||
{#if isImage(post.url)}
|
{#if post.url && !post.thumbnail_url}
|
||||||
|
<a
|
||||||
|
href={post.url}
|
||||||
|
class="max-w-full overflow-hidden overflow-ellipsis whitespace-nowrap text-sky-400 hover:underline text-xs"
|
||||||
|
>
|
||||||
|
{post.url}
|
||||||
|
</a>
|
||||||
|
{:else if isImage(post.url)}
|
||||||
<img
|
<img
|
||||||
src={post.url}
|
src={post.url}
|
||||||
alt={post.name}
|
alt={post.name}
|
||||||
|
|||||||
Reference in new issue
Block a user