diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-07 23:42:04 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-07 23:42:04 +0300 |
| commit | 7d6fc044fbcf2c6f82f759605a0fd5c1aebae55a (patch) | |
| tree | 7e8e15ddf460402b6c9555c7815297a5a9375d99 /src/components/mention_link/mention_link.js | |
| parent | 6199788f28a2665388427f6e7737f15cebd5102d (diff) | |
new mentions look
Diffstat (limited to 'src/components/mention_link/mention_link.js')
| -rw-r--r-- | src/components/mention_link/mention_link.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index ade598d8..d26ae337 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -1,7 +1,6 @@ import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' -import { getTextColor, rgb2hex } from 'src/services/color_convert/color_convert.js' import { mapGetters, mapState } from 'vuex' -import { convert } from 'chromatism' +import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js' const MentionLink = { name: 'MentionLink', @@ -45,21 +44,22 @@ const MentionLink = { highlight () { return this.mergedConfig.highlight[this.user.screen_name] }, - bg () { - if (this.highlight) return this.highlight.color + highlightType () { + return this.highlight && ('-' + this.highlight.type) }, - text () { - if (this.bg) { - const linkColor = this.mergedConfig.customTheme.colors.link - const color = getTextColor(convert(this.bg).rgb, convert(linkColor).rgb) - return rgb2hex(color) - } + highlightClass () { + if (this.highlight) return highlightClass(this.user) }, style () { - return [ - this.bg && `--mention-bg: ${this.bg}`, - this.text && `--mention-text: ${this.text}` - ].filter(_ => _).join('; ') + if (this.highlight) { + const { + backgroundColor, + backgroundPosition, + backgroundImage, + ...rest + } = highlightStyle(this.highlight) + return rest + } }, ...mapGetters(['mergedConfig']), ...mapState({ |
