From c2b44db2ac9729bda4003ec89996ae1c40840d48 Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 Date: Sun, 25 Jun 2023 15:20:06 -0400 Subject: [PATCH 1/4] Only give child comments colored borders --- src/shared/components/comment/comment-nodes.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/components/comment/comment-nodes.tsx b/src/shared/components/comment/comment-nodes.tsx index 02e621b..495b6bb 100644 --- a/src/shared/components/comment/comment-nodes.tsx +++ b/src/shared/components/comment/comment-nodes.tsx @@ -79,7 +79,7 @@ export class CommentNodes extends Component { 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 { "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 => ( Date: Sun, 25 Jun 2023 19:36:19 -0400 Subject: [PATCH 2/4] fix: Remove unnecessary string interpolations --- src/shared/components/comment/comment-node.tsx | 2 +- src/shared/components/common/vote-buttons.tsx | 4 ++-- src/shared/components/home/emojis-form.tsx | 2 +- src/shared/components/home/tagline-form.tsx | 4 ++-- src/shared/components/person/cake-day.tsx | 2 +- src/shared/components/person/profile.tsx | 4 ++-- src/shared/components/post/post-listing.tsx | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 394de6e..4ad1538 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -312,7 +312,7 @@ export class CommentNode extends Component { {cv.comment.distinguished && ( - + )} {this.isPostCreator && (
diff --git a/src/shared/components/common/vote-buttons.tsx b/src/shared/components/common/vote-buttons.tsx index 0979918..005db8c 100644 --- a/src/shared/components/common/vote-buttons.tsx +++ b/src/shared/components/common/vote-buttons.tsx @@ -174,7 +174,7 @@ export class VoteButtons extends Component { render() { return ( -
+
{showScores() ? (
{numToSI(this.props.counts.score)} diff --git a/src/shared/components/home/emojis-form.tsx b/src/shared/components/home/emojis-form.tsx index caf8221..149ff03 100644 --- a/src/shared/components/home/emojis-form.tsx +++ b/src/shared/components/home/emojis-form.tsx @@ -255,7 +255,7 @@ export class EmojiForm extends Component { >
diff --git a/src/shared/components/home/tagline-form.tsx b/src/shared/components/home/tagline-form.tsx index c79d955..bdbe1e6 100644 --- a/src/shared/components/home/tagline-form.tsx +++ b/src/shared/components/home/tagline-form.tsx @@ -71,7 +71,7 @@ export class TaglineForm extends Component { data-tippy-content={I18NextService.i18n.t("edit")} aria-label={I18NextService.i18n.t("edit")} > - + diff --git a/src/shared/components/person/cake-day.tsx b/src/shared/components/person/cake-day.tsx index ddb12be..3eeaf75 100644 --- a/src/shared/components/person/cake-day.tsx +++ b/src/shared/components/person/cake-day.tsx @@ -10,7 +10,7 @@ export class CakeDay extends Component { render() { return (
diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 70bada8..714b6be 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -647,12 +647,12 @@ export class Profile extends Component< value={this.state.banReason} onInput={linkEvent(this, this.handleModBanReasonChange)} /> -
From 17710d492cc849ea7faa8ca8e34994ae7229cbaa Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Mon, 26 Jun 2023 10:37:21 -0400 Subject: [PATCH 4/4] chore(DX): Add prettier to eslint config for use with editors --- .eslintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 81257cb..ad77740 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,7 +3,7 @@ "env": { "browser": true }, - "plugins": ["@typescript-eslint", "jsx-a11y"], + "plugins": ["@typescript-eslint", "jsx-a11y", "prettier"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", @@ -41,6 +41,7 @@ "no-var": 0, "prefer-const": 1, "prefer-rest-params": 0, + "prettier/prettier": "error", "quote-props": 0, "unicorn/filename-case": 0 }