]> Untitled Git - lemmy.git/commitdiff
Switching back to going directly to link if it has a url.
authorDessalines <tyhou13@gmx.com>
Thu, 25 Apr 2019 22:00:05 +0000 (15:00 -0700)
committerDessalines <tyhou13@gmx.com>
Thu, 25 Apr 2019 22:00:05 +0000 (15:00 -0700)
ui/src/components/post-listing.tsx

index 198c8e8eb192ffaba1fcf95a171e09806a4dae8b..6790343b259a125da78e4c7d788abf62f51416d2 100644 (file)
@@ -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>