Skip to content

Commit 39442bc

Browse files
committed
invert icon-x color when tag text color is inverted
1 parent 0cf6487 commit 39442bc

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

browser/main/Detail/TagSelect.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,17 @@ class TagSelect extends React.Component {
186186
? (showTagsAlphabetically ? _.sortBy(value) : value).map((tag) => {
187187
const wrapperStyle = {}
188188
const textStyle = {}
189+
const BLACK = '#333333'
190+
const WHITE = '#f1f1f1'
189191
const color = coloredTags[tag]
192+
const invertedColor = color && invertColor(color, { black: BLACK, white: WHITE })
193+
let iconRemove = '../resources/icon/icon-x.svg'
190194
if (color) {
191195
wrapperStyle.backgroundColor = color
192-
textStyle.color = invertColor(color, { black: '#222', white: '#f1f1f1' })
196+
textStyle.color = invertedColor
197+
}
198+
if (invertedColor === WHITE) {
199+
iconRemove = '../resources/icon/icon-x-light.svg'
193200
}
194201
return (
195202
<span styleName='tag'
@@ -200,7 +207,7 @@ class TagSelect extends React.Component {
200207
<button styleName='tag-removeButton'
201208
onClick={(e) => this.handleTagRemoveButtonClick(tag)}
202209
>
203-
<img className='tag-removeButton-icon' src='../resources/icon/icon-x.svg' width='8px' />
210+
<img className='tag-removeButton-icon' src={iconRemove} width='8px' />
204211
</button>
205212
</span>
206213
)

resources/icon/icon-x-light.svg

+17
Loading

0 commit comments

Comments
 (0)