summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-listing.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-25 15:00:05 -0700
committerDessalines <tyhou13@gmx.com>2019-04-25 15:00:05 -0700
commit89bb346e639b45c2d997e9e638aed42b1dd96c87 (patch)
treeb310c0bd3c539e2dd3c3fa9be161ff150deb5c47 /ui/src/components/post-listing.tsx
parente4532aa1cb19decb5f57fca13ca20aae3e1e0a1e (diff)
Switching back to going directly to link if it has a url.
Diffstat (limited to 'ui/src/components/post-listing.tsx')
-rw-r--r--ui/src/components/post-listing.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index 198c8e8e..6790343b 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -71,7 +71,12 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
}
<div className="ml-4">
<div>
- <h5 className="mb-0 d-inline"><Link className="text-white" to={`/post/${post.id}`}>{post.name}</Link></h5>
+ <h5 className="mb-0 d-inline">
+ {post.url ?
+ <a className="text-white" href={post.url} target="_blank" title={post.url}>{post.name}</a> :
+ <Link className="text-white" to={`/post/${post.id}`} title="Comments">{post.name}</Link>
+ }
+ </h5>
{post.url &&
<small>
<a className="ml-2 text-muted font-italic" href={post.url} target="_blank" title={post.url}>{(new URL(post.url)).hostname}</a>