fix empty source links.

This commit is contained in:
Jason Schwarzenberger 2020-11-20 17:02:09 +13:00
parent a86eb98c1a
commit a2e5faa3b5

View File

@ -16,12 +16,11 @@ export const sourceLink = (story) => {
export const infoLine = (story) => (
<div className="info">
{story.score} points by <a href={story.author_link}>{story.author}</a>
&#8203; {moment.unix(story.date).fromNow()}
&#8203; on <a href={story.link}>{story.source}</a> | &#8203;
<Link
&#8203; {moment.unix(story.date).fromNow()}
&#8203; on {story.link ? <a href={story.link}>{story.source}</a> : story.source}
| &#8203; <Link
className={story.num_comments > 99 ? "hot" : ""}
to={"/" + story.id + "/c"}
>
to={"/" + story.id + "/c"}>
{story.num_comments} comment{story.num_comments !== 1 && "s"}
</Link>
</div>