diff --git a/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue b/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue index 477962745..a32e3c36a 100644 --- a/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue @@ -11,34 +11,34 @@ class="bg-white dark:bg-slate-900 flex flex-col h-[inherit] w-[inherit]" @click="onClose" > -
+

{{ senderDetails.name }}

{{ readableTime }}
{{ fileNameFromDataUrl }} @@ -53,7 +53,7 @@ color-scheme="secondary" variant="clear" icon="zoom-in" - @click="onZoom(0.05)" + @click="onZoom(0.1)" />
-
+
-
+
-
+
@@ -191,6 +191,9 @@ const ALLOWED_FILE_TYPES = { AUDIO: 'audio', }; +const MAX_ZOOM_LEVEL = 2; +const MIN_ZOOM_LEVEL = 1; + export default { components: { Thumbnail, @@ -269,7 +272,7 @@ export default { imageRotationStyle() { return { transform: `rotate(${this.activeImageRotation}deg) scale(${this.zoomScale})`, - cursor: this.zoomScale < 1.5 ? 'zoom-in' : 'zoom-out', + cursor: this.zoomScale < MAX_ZOOM_LEVEL ? 'zoom-in' : 'zoom-out', }; }, }, @@ -336,19 +339,19 @@ export default { } }, onClickZoomImage() { - this.onZoom(0.05); + this.onZoom(0.1); }, onZoom(scale) { if (!this.isImage) { return; } - // Reset zoom scale if it is 1.5 - if (scale > 0 && this.zoomScale >= 1.5) { + + if (scale > 0 && this.zoomScale >= MAX_ZOOM_LEVEL) { this.zoomScale = 1; return; } - // Reset zoom scale if it is 0.5 - if (scale < 0 && this.zoomScale <= 0.5) { + + if (scale < 0 && this.zoomScale <= MIN_ZOOM_LEVEL) { this.zoomScale = 1; return; } @@ -358,7 +361,7 @@ export default { if (!this.isImage) { return; } - const scale = e.deltaY > 0 ? -0.05 : 0.05; + const scale = e.deltaY > 0 ? -0.1 : 0.1; this.onZoom(scale); }, },