Show post title in user comments sidebar (#244)

* show post title in user comments sidebar #241

* trim title with ellipsis

* show post title in user comments sidebar #241: post-review

* adjust to make user comments post title the same as last comments widget style

* remove user comments post title margin

* revert to f35ecc75b0
This commit is contained in:
Misha Vyrtsev
2019-01-09 16:20:55 +02:00
committed by Igor Adamenko
parent e5c8ac18de
commit 57ffa5d491
3 changed files with 27 additions and 0 deletions
@@ -6,4 +6,5 @@
padding-right: 84px;
font-size: 14px;
line-height: 16px;
position: relative;
}
@@ -5,4 +5,22 @@
display: block;
}
}
.comment__title {
margin-bottom: 0.2rem;
}
.comment__title-link {
color: #0e7e9d;
font-weight: bold;
text-decoration: none;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
display: block;
&:hover {
opacity: 0.75;
}
}
}
+8
View File
@@ -468,6 +468,14 @@ export default class Comment extends Component {
className={b('comment', props, defaultMods)}
id={mods.disabled ? null : `${COMMENT_NODE_CLASSNAME_PREFIX}${o.id}`}
>
{mods.view === 'user' &&
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__body">
<div className="comment__info">
{mods.view !== 'user' && <Avatar picture={o.user.picture} />}