From cca3486a68866d3e4276acdc6c6fe1040f1cf1b6 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 1 Jul 2019 21:15:00 +0200 Subject: [PATCH] Use a positive setting name to avoid double negatives --- extensions/tags/js/src/common/helpers/tagIcon.js | 3 ++- extensions/tags/js/src/common/helpers/tagLabel.js | 2 +- extensions/tags/js/src/forum/components/TagHero.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extensions/tags/js/src/common/helpers/tagIcon.js b/extensions/tags/js/src/common/helpers/tagIcon.js index 529fbcb5a..1e5ba9066 100644 --- a/extensions/tags/js/src/common/helpers/tagIcon.js +++ b/extensions/tags/js/src/common/helpers/tagIcon.js @@ -1,5 +1,6 @@ export default function tagIcon(tag, attrs = {}, settings = {}) { const hasIcon = tag && tag.icon(); + const useColor = settings.useColor || true; attrs.className = hasIcon ? 'icon ' + tag.icon() + ' ' + (attrs.className || '') : 'icon TagIcon ' + (attrs.className || ''); @@ -7,7 +8,7 @@ export default function tagIcon(tag, attrs = {}, settings = {}) { attrs.style = attrs.style || {}; if (hasIcon) { - attrs.style.color = settings.disableColors ? '' : tag.color(); + attrs.style.color = useColor ? tag.color() : ''; } else { attrs.style.backgroundColor = tag.color(); } diff --git a/extensions/tags/js/src/common/helpers/tagLabel.js b/extensions/tags/js/src/common/helpers/tagLabel.js index 9d815a8d8..f52be00df 100644 --- a/extensions/tags/js/src/common/helpers/tagLabel.js +++ b/extensions/tags/js/src/common/helpers/tagLabel.js @@ -26,7 +26,7 @@ export default function tagLabel(tag, attrs = {}) { return ( m((link ? 'a' : 'span'), attrs, - {tag.icon() && tagIcon(tag, {}, {disableColors: true})} {tagText} + {tag.icon() && tagIcon(tag, {}, {useColor: false})} {tagText} ) ); diff --git a/extensions/tags/js/src/forum/components/TagHero.js b/extensions/tags/js/src/forum/components/TagHero.js index 7567c0953..b11946b0a 100644 --- a/extensions/tags/js/src/forum/components/TagHero.js +++ b/extensions/tags/js/src/forum/components/TagHero.js @@ -11,7 +11,7 @@ export default class TagHero extends Component { style={color ? {color: '#fff', backgroundColor: color} : ''}>
-

{tag.icon() && tagIcon(tag, {}, { disableColors: true })} {tag.name()}

+

{tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}

{tag.description()}