diff --git a/js/src/common/components/Button.tsx b/js/src/common/components/Button.tsx index 93138eb81..6f03242c4 100644 --- a/js/src/common/components/Button.tsx +++ b/js/src/common/components/Button.tsx @@ -53,7 +53,7 @@ export default class Button extends Compone const loading = extract(attrs, 'loading'); if (attrs.disabled || loading) { - attrs.className += ' ' + classNames('disabled', loading && 'loading'); + attrs.className = classNames(attrs.className, 'disabled', loading && 'loading'); delete attrs.onclick; } diff --git a/js/src/common/helpers/listItems.tsx b/js/src/common/helpers/listItems.tsx index cd1ce2f31..ddd12ee97 100644 --- a/js/src/common/helpers/listItems.tsx +++ b/js/src/common/helpers/listItems.tsx @@ -43,7 +43,7 @@ export default function listItems(items) { item ) : (
  • {item} diff --git a/js/src/forum/components/CommentPost.tsx b/js/src/forum/components/CommentPost.tsx index 3420ab440..a12a56b6b 100644 --- a/js/src/forum/components/CommentPost.tsx +++ b/js/src/forum/components/CommentPost.tsx @@ -81,16 +81,14 @@ export default class CommentPost extends Post { const post = this.props.post; const attrs = super.attrs(); - attrs.className = - (attrs.className || '') + - ' ' + - classNames({ - CommentPost: true, - 'Post--hidden': post.isHidden(), - 'Post--edited': post.isEdited(), - revealContent: this.revealContent, - editing: this.isEditing(), - }); + attrs.className = classNames( + attrs.className, + 'CommentPost', + post.isHidden() && 'Post--hidden', + post.isEdited() && 'Post--edited', + this.revealContent && 'revealContent', + this.isEditing() && 'editing' + ); return attrs; } diff --git a/js/src/forum/components/Search.tsx b/js/src/forum/components/Search.tsx index cfafc57e9..1c438bccd 100644 --- a/js/src/forum/components/Search.tsx +++ b/js/src/forum/components/Search.tsx @@ -76,15 +76,13 @@ export default class Search extends Component { return (