Only give child comments colored borders
authorSleeplessOne1917 <abias1122@gmail.com>
Sun, 25 Jun 2023 19:20:06 +0000 (15:20 -0400)
committerJay Sitter <jay@jaysitter.com>
Mon, 26 Jun 2023 22:30:31 +0000 (18:30 -0400)
src/shared/components/comment/comment-nodes.tsx

index 02e621b7fcf2c7b775afe52583359ce8bddd7b4c..495b6bbc66d96949a6e1d4ab4e5f8844ad2de52f 100644 (file)
@@ -79,7 +79,7 @@ export class CommentNodes extends Component<CommentNodesProps, any> {
     const maxComments = this.props.maxCommentsShown ?? this.props.nodes.length;
 
     const borderColor = this.props.depth
-      ? colorList[this.props.depth % colorList.length]
+      ? colorList[(this.props.depth - 1) % colorList.length]
       : colorList[0];
 
     return (
@@ -89,7 +89,11 @@ export class CommentNodes extends Component<CommentNodesProps, any> {
             "ms-1": !!this.props.isChild,
             "border-top border-light": !this.props.noBorder,
           })}
-          style={`border-left: 2px solid ${borderColor} !important;`}
+          style={
+            this.props.isChild
+              ? `border-left: 2px solid ${borderColor} !important;`
+              : undefined
+          }
         >
           {this.props.nodes.slice(0, maxComments).map(node => (
             <CommentNode