summaryrefslogtreecommitdiffstats
path: root/ui/src/components/comment-node.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-03-05 15:10:46 -0500
committerDessalines <tyhou13@gmx.com>2020-03-05 15:10:46 -0500
commit858366c57b959c0b2bc6e2a43ca194084a1ff0d8 (patch)
tree8586bd9ed92d9f62f9e69251e264b738e6c166a6 /ui/src/components/comment-node.tsx
parent25fa97a20af8ef244bc5e934670a3a81a4eff589 (diff)
Proper comment-node depth coloring.
Diffstat (limited to 'ui/src/components/comment-node.tsx')
-rw-r--r--ui/src/components/comment-node.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx
index 19c83423..db3c589d 100644
--- a/ui/src/components/comment-node.tsx
+++ b/ui/src/components/comment-node.tsx
@@ -27,7 +27,7 @@ import {
pictshareAvatarThumbnail,
showAvatars,
setupTippy,
- randomHsl,
+ colorList,
} from '../utils';
import moment from 'moment';
import { MomentTime } from './moment-time';
@@ -94,7 +94,9 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
score: this.props.node.comment.score,
upvotes: this.props.node.comment.upvotes,
downvotes: this.props.node.comment.downvotes,
- borderColor: randomHsl(),
+ borderColor: this.props.node.comment.depth
+ ? colorList[this.props.node.comment.depth % colorList.length]
+ : colorList[0],
};
constructor(props: any, context: any) {