mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 04:57:51 +00:00 
			
		
		
		
	This PR adds RTL support to the web widget for improved right-to-left language compatibility, updates colors, and cleans up code. Fixes https://linear.app/chatwoot/issue/CW-4089/rtl-issues-on-widget https://github.com/chatwoot/chatwoot/issues/9791 Other PR: https://github.com/chatwoot/chatwoot/pull/11016
		
			
				
	
	
		
			48 lines
		
	
	
		
			938 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			938 B
		
	
	
	
		
			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>
 | 
						|
 | 
						|
<!-- eslint-disable-next-line vue/no-root-v-if -->
 | 
						|
<template>
 | 
						|
  <div v-if="showBannerMessage" :class="`banner ${bannerType}`">
 | 
						|
    <span>
 | 
						|
      {{ bannerMessage }}
 | 
						|
    </span>
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
 | 
						|
<style scoped lang="scss">
 | 
						|
.banner {
 | 
						|
  @apply text-white text-sm font-semibold p-3 text-center;
 | 
						|
 | 
						|
  &.success {
 | 
						|
    @apply bg-n-teal-9;
 | 
						|
  }
 | 
						|
 | 
						|
  &.error {
 | 
						|
    @apply bg-n-ruby-9;
 | 
						|
  }
 | 
						|
}
 | 
						|
</style>
 |