summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-24 10:26:15 -0700
committerDessalines <tyhou13@gmx.com>2019-04-24 10:26:15 -0700
commitb70fa604187e16015c7c6f71f8b48d4f21594f0c (patch)
tree834e8cf073c18e3a8a67fba520c48ca4ef9dce3a /ui
parent73c409fd0ffd05aea7e45eda80a8963ab292f37c (diff)
Adding image thumbnails.
Diffstat (limited to 'ui')
-rw-r--r--ui/src/components/post-listing.tsx5
-rw-r--r--ui/src/css/main.css5
2 files changed, 9 insertions, 1 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index babb8605..e0ddd310 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -66,6 +66,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<svg class="icon downvote"><use xlinkHref="#icon-arrow-down"></use></svg>
</div>
</div>
+ {post.url && isImage(post.url) &&
+ <a href={post.url} target="_blank"><img class="mx-2 float-left img-fluid thumbnail rounded" src={post.url} /></a>
+ }
<div className="ml-4">
{post.url
? <div className="mb-0">
@@ -86,7 +89,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<span>
<span class="pointer ml-2 badge badge-light text-muted small" onClick={linkEvent(this, this.handleImageExpandClick)}>-</span>
<div>
- <img class="img-fluid" src={post.url} />
+ <a href={post.url} target="_blank"><img class="img-fluid" src={post.url} /></a>
</div>
</span>
}
diff --git a/ui/src/css/main.css b/ui/src/css/main.css
index 61acb014..5af8a0f5 100644
--- a/ui/src/css/main.css
+++ b/ui/src/css/main.css
@@ -95,3 +95,8 @@ blockquote {
.new-comments:hover {
overflow-y: auto;
}
+
+.thumbnail {
+ max-height: 50px;
+ max-width: 50px;
+}