feat: Display reply time in widget (#1349)

Fixes #1132
This commit is contained in:
Pranav Raj S
2020-10-18 23:32:22 +05:30
committed by GitHub
parent bd11b2ec58
commit 85514cae8d
43 changed files with 707 additions and 345 deletions

View File

@@ -10,6 +10,7 @@
</div>
</template>
<script>
import { getContrastingTextColor } from 'shared/helpers/ColorHelper';
export default {
props: {
title: {
@@ -43,12 +44,7 @@ export default {
},
computed: {
textColor() {
const color = this.bgColor.replace('#', '');
const r = parseInt(color.slice(0, 2), 16);
const g = parseInt(color.slice(2, 4), 16);
const b = parseInt(color.slice(4, 6), 16);
// http://stackoverflow.com/a/3943023/112731
return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF';
return getContrastingTextColor(this.bgColor);
},
labelClass() {
return `label ${this.small ? 'small' : ''}`;