mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-31 19:17:48 +00:00
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
59 lines
1.2 KiB
Vue
59 lines
1.2 KiB
Vue
<script>
|
|
export default {
|
|
props: {
|
|
block: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
type: {
|
|
type: String,
|
|
default: 'blue',
|
|
},
|
|
bgColor: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
textColor: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
computed: {
|
|
buttonClassName() {
|
|
let className = 'text-white py-3 px-4 rounded shadow-sm leading-4';
|
|
if (this.type === 'clear') {
|
|
className = 'flex mx-auto mt-4 text-xs leading-3 w-auto text-black-600';
|
|
}
|
|
|
|
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;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<button :class="buttonClassName" :style="buttonStyles" :disabled="disabled">
|
|
<slot />
|
|
</button>
|
|
</template>
|