Remove parentheses when time ago not present (#6379) [deploy]

This commit is contained in:
Ben Halpern 2020-02-29 14:05:45 -05:00 committed by GitHub
parent 501f70bd9f
commit ec50515810
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,11 @@ export const Article = ({
return <PodcastArticle article={article} />;
}
const timeAgoIndicator = timeAgo({
oldTimeInSeconds: article.published_at_int,
formatter: x => x,
})
return (
<div
className="single-article single-article-small-pic"
@ -89,12 +94,7 @@ export const Article = ({
)}
{article.published_at_int ? (
<span className="time-ago-indicator">
(
{timeAgo({
oldTimeInSeconds: article.published_at_int,
formatter: x => x,
})}
)
{timeAgoIndicator.length > 0 ? `(${timeAgoIndicator})`: '' }
</span>
) : null}
</a>