mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +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>
53 lines
1.0 KiB
Vue
53 lines
1.0 KiB
Vue
<script>
|
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
|
import { emitter } from 'shared/helpers/mitt';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
showBannerMessage: false,
|
|
bannerMessage: '',
|
|
bannerType: 'error',
|
|
};
|
|
},
|
|
mounted() {
|
|
emitter.on(BUS_EVENTS.SHOW_ALERT, ({ message, type = 'error' }) => {
|
|
this.bannerMessage = message;
|
|
this.bannerType = type;
|
|
this.showBannerMessage = true;
|
|
setTimeout(() => {
|
|
this.showBannerMessage = false;
|
|
}, 3000);
|
|
});
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="showBannerMessage" :class="`banner ${bannerType}`">
|
|
<span>
|
|
{{ bannerMessage }}
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
@import 'widget/assets/scss/variables.scss';
|
|
|
|
.banner {
|
|
color: $color-white;
|
|
font-size: $font-size-default;
|
|
font-weight: $font-weight-bold;
|
|
padding: $space-slab;
|
|
text-align: center;
|
|
|
|
&.success {
|
|
background: $color-success;
|
|
}
|
|
|
|
&.error {
|
|
background: $color-error;
|
|
}
|
|
}
|
|
</style>
|