From 9ec3e9a525e142894b04d03865f7a5395c30cb49 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Sun, 18 Dec 2022 17:25:41 +0300 Subject: [PATCH] Comments decorations --- src/components/Article/Comment.module.scss | 52 ++++++++++++++++++---- src/components/Article/Comment.tsx | 2 +- src/components/Article/CommentsTree.tsx | 2 +- src/locales/ru.json | 2 +- src/styles/Article.module.scss | 14 ++++++ 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/src/components/Article/Comment.module.scss b/src/components/Article/Comment.module.scss index 02f4ca87..a4f8dc15 100644 --- a/src/components/Article/Comment.module.scss +++ b/src/components/Article/Comment.module.scss @@ -1,18 +1,40 @@ .comment { background-color: #fff; - margin: 0 -2.4rem 1.5em; + margin: 0 -2.4rem 0.5em; padding: 0.8rem 2.4rem; transition: background-color 0.3s; + position: relative; - &:hover { - background-color: #f6f6f6; + &:last-child { + margin-bottom: 0; + } - .commentControlReply, - .commentControlShare, - .commentControlDelete, - .commentControlEdit, - .commentControlComplain { - opacity: 1; + .comment { + &:before, + &:after { + content: ''; + left: 0; + position: absolute; + } + + &:before { + border-bottom: 2px solid #ccc; + border-left: 2px solid #ccc; + border-radius: 0 0 0 1.2rem; + top: -1rem; + height: 2.4rem; + width: 1.2rem; + } + + &:after { + background: #ccc; + height: 100%; + top: 0; + width: 2px; + } + + &:last-child:after { + display: none; } } @@ -32,6 +54,18 @@ } } +.commentContent { + &:hover { + .commentControlReply, + .commentControlShare, + .commentControlDelete, + .commentControlEdit, + .commentControlComplain { + opacity: 1; + } + } +} + .commentControls { @include font-size(1.2rem); margin-bottom: 0.5em; diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index 89401946..8568b627 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -135,7 +135,7 @@ export default (props: {