show comment's post title in last comments widget only if it exists

This commit is contained in:
igoradamenko
2019-01-06 11:42:01 +02:00
parent 4096302a06
commit d8c20da881
+7 -5
View File
@@ -438,11 +438,13 @@ export default class Comment extends Component {
return (
<article className={b('comment', props, defaultMods)}>
<div className="comment__body">
<div className="comment__title">
<a className="comment__title-link" href={`${o.locator.url}#${COMMENT_NODE_CLASSNAME_PREFIX}${o.id}`}>
{o.title}
</a>
</div>
{!!o.title && (
<div className="comment__title">
<a className="comment__title-link" href={`${o.locator.url}#${COMMENT_NODE_CLASSNAME_PREFIX}${o.id}`}>
{o.title}
</a>
</div>
)}
<div className="comment__info">
<a href={`${o.locator.url}#${COMMENT_NODE_CLASSNAME_PREFIX}${o.id}`} className="comment__username">
{o.user.name}