From 31681610f25ca33767a67a49aec6cf5243cf0536 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 16 May 2025 22:01:16 +0530 Subject: [PATCH] feat: disable lightbox in UI shell --- .../components-next/message/bubbles/Image.vue | 7 +++--- .../components-next/message/bubbles/Video.vue | 7 +++--- .../components-next/message/chips/Image.vue | 7 +++--- .../components-next/message/chips/Video.vue | 8 +++---- .../components-next/message/useGallery.js | 23 +++++++++++++++++++ 5 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 app/javascript/dashboard/components-next/message/useGallery.js diff --git a/app/javascript/dashboard/components-next/message/bubbles/Image.vue b/app/javascript/dashboard/components-next/message/bubbles/Image.vue index 2484bb06c..20d243841 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Image.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Image.vue @@ -5,6 +5,7 @@ import { useAlert } from 'dashboard/composables'; import BaseBubble from './Base.vue'; import Button from 'next/button/Button.vue'; import Icon from 'next/icon/Icon.vue'; +import { useGallery } from '../useGallery'; import { useSnakeCase } from 'dashboard/composables/useTransformKeys'; import { useMessageContext } from '../provider.js'; import { downloadFile } from '@chatwoot/utils'; @@ -21,8 +22,8 @@ const attachment = computed(() => { }); const hasError = ref(false); -const showGallery = ref(false); const isDownloading = ref(false); +const { showGallery, isGalleryAllowed, toggleGallery } = useGallery(); const handleError = () => { hasError.value = true; @@ -46,7 +47,7 @@ const downloadAttachment = async () => {
@@ -82,7 +83,7 @@ const downloadAttachment = async () => {
{ @@ -30,7 +31,7 @@ const isReel = computed(() => {
{
import { ref } from 'vue'; import Icon from 'next/icon/Icon.vue'; +import { useGallery } from '../useGallery'; import { useSnakeCase } from 'dashboard/composables/useTransformKeys'; import { useMessageContext } from '../provider.js'; @@ -13,7 +14,7 @@ defineProps({ }, }); const hasError = ref(false); -const showGallery = ref(false); +const { showGallery, toggleGallery, isGalleryAllowed } = useGallery(); const { filteredCurrentChatAttachments } = useMessageContext(); @@ -25,7 +26,7 @@ const handleError = () => {