diff --git a/src/components/Article/Comment.module.scss b/src/components/Article/Comment.module.scss index ce52e65a..a4f8dc15 100644 --- a/src/components/Article/Comment.module.scss +++ b/src/components/Article/Comment.module.scss @@ -9,11 +9,32 @@ margin-bottom: 0; } - $levels: 0, 1, 2, 3, 4; - $padding: 1rem; - @each $level in $levels { - &.commentLevel-#{level} { - padding-left: $padding * $level; + .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; } } diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index 402ff5f5..db77395c 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -13,6 +13,7 @@ import { SharePopup } from './SharePopup' import stylesHeader from '../Nav/Header.module.scss' import Userpic from '../Author/Userpic' import { apiClient } from '../../utils/apiClient' +import { ReactionKind } from '../../graphql/types.gen' type Props = { level?: number @@ -41,20 +42,18 @@ export default (props: Props) => { event.preventDefault() // await createReaction({ await apiClient.createReaction({ + kind: 7, replyTo: props.parent, body: postMessageText(), - shout: comment().shout.slug, - kind: 7 + shout: comment().shout.id }) } const formattedDate = createMemo(() => formatDate(new Date(comment()?.createdAt), { hour: 'numeric', minute: 'numeric' }) ) - console.log('!!! lvl:', props.level) return ( -