From c0d3feed95df03d0244bc104d1ceec27a297613b Mon Sep 17 00:00:00 2001 From: Vyrtsev Mikhail Date: Mon, 7 Jan 2019 12:21:07 +0300 Subject: [PATCH] show post title in user comments sidebar #241 --- .../components/comment/__info/comment__info.scss | 1 + .../components/comment/__title/comment__title.scss | 13 +++++++++++++ web/app/components/comment/comment.jsx | 8 ++++++++ web/app/components/comment/index.js | 1 + 4 files changed, 23 insertions(+) create mode 100644 web/app/components/comment/__title/comment__title.scss 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/__title/comment__title.scss b/web/app/components/comment/__title/comment__title.scss new file mode 100644 index 00000000..1333f31a --- /dev/null +++ b/web/app/components/comment/__title/comment__title.scss @@ -0,0 +1,13 @@ +.comment__title { + margin-bottom: 0.2rem; + + &-link { + color: #0e7e9d; + font-weight: bold; + text-decoration: none; + + &: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' && } diff --git a/web/app/components/comment/index.js b/web/app/components/comment/index.js index deb63a1b..d1472897 100644 --- a/web/app/components/comment/index.js +++ b/web/app/components/comment/index.js @@ -21,6 +21,7 @@ require('./__control/_select-label/comment__control_select-label.scss'); require('./__control/_view/_inactive/comment__control_view_inactive.scss'); require('./__controls/comment__controls.scss'); +require('./__title/comment__title.scss'); require('./__info/comment__info.scss'); require('./__input/comment__input.scss'); require('./__link-to-parent/comment__link-to-parent.scss');