fix: Update the suspended page to show the chat bubble (#9604)

- This PR updates the implementation of chat bubble on suspended account.
This commit is contained in:
Pranav
2024-06-06 16:39:39 -07:00
committed by GitHub
parent 75c83dd0d9
commit 76efe3c5c3

View File

@@ -1,24 +1,30 @@
<script setup>
import EmptyState from 'dashboard/components/widgets/EmptyState.vue';
import { onMounted } from 'vue';
const toggleSupportWidgetVisibility = () => {
if (window.$chatwoot) {
window.$chatwoot.toggleBubbleVisibility('show');
}
};
const setupListenerForWidgetEvent = () => {
window.addEventListener('chatwoot:on-message', () => {
toggleSupportWidgetVisibility();
});
};
onMounted(() => {
toggleSupportWidgetVisibility();
setupListenerForWidgetEvent();
});
</script>
<template>
<div class="suspended-page">
<div class="items-center bg-slate-50 flex justify-center h-full w-full">
<empty-state
:title="$t('APP_GLOBAL.ACCOUNT_SUSPENDED.TITLE')"
:message="$t('APP_GLOBAL.ACCOUNT_SUSPENDED.MESSAGE')"
/>
</div>
</template>
<script>
import EmptyState from 'dashboard/components/widgets/EmptyState.vue';
export default {
components: { EmptyState },
};
</script>
<style scoped>
.suspended-page {
align-items: center;
background: var(--s-50);
display: flex;
justify-content: center;
height: 100%;
width: 100%;
}
</style>