resolve conversation
This commit is contained in:
parent
1ddfc8e9a5
commit
a5ae274c3e
|
@ -3,7 +3,6 @@
|
|||
margin: 0 -2.4rem 1.5em;
|
||||
padding: 0.8rem 2.4rem;
|
||||
transition: background-color 0.3s;
|
||||
border: 1px solid red;
|
||||
|
||||
&:hover {
|
||||
background-color: #f6f6f6;
|
||||
|
@ -33,26 +32,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
//.commentLevel1 {
|
||||
// margin-left: 3.2rem;
|
||||
//}
|
||||
//
|
||||
//.commentLevel2 {
|
||||
// margin-left: 6.4rem;
|
||||
//}
|
||||
//
|
||||
//.commentLevel3 {
|
||||
// margin-left: 9.6rem;
|
||||
//}
|
||||
//
|
||||
//.commentLevel4 {
|
||||
// margin-left: 12.8rem;
|
||||
//}
|
||||
//
|
||||
//.commentLevel5 {
|
||||
// margin-left: 16rem;
|
||||
//}
|
||||
|
||||
.commentControls {
|
||||
@include font-size(1.2rem);
|
||||
margin-bottom: 0.5em;
|
||||
|
|
|
@ -56,15 +56,16 @@ export const CommentsTree = (props: { shoutSlug: string }) => {
|
|||
|
||||
function nestComments(commentList) {
|
||||
const commentMap = {}
|
||||
commentList.forEach((comment) => (commentMap[comment.id] = comment))
|
||||
commentList.forEach((comment) => {
|
||||
if (comment.replyTo !== null) {
|
||||
commentMap[comment.id] = comment
|
||||
if (comment.replyTo) {
|
||||
if (!comment.replyTo) return
|
||||
const parent = commentMap[comment.replyTo]
|
||||
;(parent.children = parent.children || []).push(comment)
|
||||
}
|
||||
})
|
||||
return commentList.filter((comment) => {
|
||||
return comment.replyTo === null
|
||||
return !comment.replyTo
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user