diff options
| author | lambda <pleromagit@rogerbraun.net> | 2018-08-12 16:14:35 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2018-08-12 16:14:35 +0000 |
| commit | 25be51e2c1d9ca7ab112682c59ffadd6d1b63276 (patch) | |
| tree | b04030b899850b503097c2df1e7fde2a13043a7f /src/components/user_card_content/user_card_content.js | |
| parent | db6ff4824afa7adca1f3b633278e9ed033d8671d (diff) | |
| parent | 27adde9887d7205703ed461560f3272f6709b83b (diff) | |
Merge branch 'feature/accountHighlight' into 'develop'
Account highlight
See merge request pleroma/pleroma-fe!285
Diffstat (limited to 'src/components/user_card_content/user_card_content.js')
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 4d4266cb..76a5577e 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -9,11 +9,6 @@ export default { if (color) { const rgb = hex2rgb(color) const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .5)` - console.log(rgb) - console.log([ - `url(${this.user.cover_photo})`, - `linear-gradient(to bottom, ${tintColor}, ${tintColor})` - ].join(', ')) return { backgroundColor: `rgb(${Math.floor(rgb.r * 0.53)}, ${Math.floor(rgb.g * 0.56)}, ${Math.floor(rgb.b * 0.59)})`, backgroundImage: [ @@ -37,6 +32,29 @@ export default { dailyAvg () { const days = Math.ceil((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000)) return Math.round(this.user.statuses_count / days) + }, + userHighlightType: { + get () { + const data = this.$store.state.config.highlight[this.user.screen_name] + return data && data.type || 'disabled' + }, + set (type) { + const data = this.$store.state.config.highlight[this.user.screen_name] + if (type !== 'disabled') { + this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: data && data.color || '#FFFFFF', type }) + } else { + this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: undefined }) + } + } + }, + userHighlightColor: { + get () { + const data = this.$store.state.config.highlight[this.user.screen_name] + return data && data.color + }, + set (color) { + this.$store.dispatch('setHighlight', { user: this.user.screen_name, color }) + } } }, components: { |
