From 57ffa5d491ecf685a42ac45ac479b35c7b63c4d3 Mon Sep 17 00:00:00 2001 From: Misha Vyrtsev Date: Wed, 9 Jan 2019 17:20:55 +0300 Subject: [PATCH] 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 f35ecc75b09d01baa6410b7784ba4bc6df68fec2 --- .../comment/__info/comment__info.scss | 1 + .../comment/_view/_user/comment_view_user.scss | 18 ++++++++++++++++++ web/app/components/comment/comment.jsx | 8 ++++++++ 3 files changed, 27 insertions(+) diff --git a/web/app/components/comment/__info/comment__info.scss b/web/app/components/comment/__info/comment__info.scss index fc04b1fa..f97b63df 100644 --- a/web/app/components/comment/__info/comment__info.scss +++ b/web/app/components/comment/__info/comment__info.scss @@ -6,4 +6,5 @@ padding-right: 84px; font-size: 14px; line-height: 16px; + position: relative; } diff --git a/web/app/components/comment/_view/_user/comment_view_user.scss b/web/app/components/comment/_view/_user/comment_view_user.scss index 85547936..5428e144 100644 --- a/web/app/components/comment/_view/_user/comment_view_user.scss +++ b/web/app/components/comment/_view/_user/comment_view_user.scss @@ -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; + } + } } diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 266dbe50..d59e0b70 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -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 && ( +
+ + {o.title} + +
+ )}
{mods.view !== 'user' && }