-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Display reply time in widget (#1349)
Fixes #1132
- Loading branch information
Pranav Raj S
authored
Oct 18, 2020
1 parent
bd11b2e
commit 85514ca
Showing
43 changed files
with
707 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
.button { | ||
font-family: $body-font-family; | ||
font-weight: $font-weight-medium; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,4 @@ | |
@import '~bourbon/core/bourbon'; | ||
|
||
@include foundation-everything($flex: true); | ||
|
||
@import 'woot'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<button :class="buttonClassName" :style="buttonStyles" @click="onClick"> | ||
<slot></slot> | ||
</button> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
block: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
type: { | ||
type: String, | ||
default: 'blue', | ||
}, | ||
bgColor: { | ||
type: String, | ||
default: '', | ||
}, | ||
textColor: { | ||
type: String, | ||
default: '', | ||
}, | ||
}, | ||
computed: { | ||
buttonClassName() { | ||
let className = 'text-white py-3 px-4 rounded shadow-sm'; | ||
if (this.type === 'blue' && !Object.keys(this.buttonStyles).length) { | ||
className = `${className} bg-woot-500 hover:bg-woot-700`; | ||
} | ||
if (this.block) { | ||
className = `${className} w-full`; | ||
} | ||
return className; | ||
}, | ||
buttonStyles() { | ||
const styles = {}; | ||
if (this.bgColor) { | ||
styles.backgroundColor = this.bgColor; | ||
} | ||
if (this.textColor) { | ||
styles.color = this.textColor; | ||
} | ||
return styles; | ||
}, | ||
}, | ||
methods: { | ||
onClick(e) { | ||
this.$emit('click', e); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ export default { | |
}, | ||
minHeight: { | ||
type: Number, | ||
default: 3.2, | ||
default: 2, | ||
}, | ||
}, | ||
watch: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const getContrastingTextColor = bgColor => { | ||
const color = 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'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.