fix customer invite photo
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="customer-profile-card">
|
||||
<button v-if="photoURL" type="button" class="avatar-trigger" @click.stop="openPhotoViewer">
|
||||
<button v-if="photoURL" type="button" class="avatar-trigger" @click="handlePhotoClick">
|
||||
<t-image :src="photoURL" :alt="customerName" fit="cover" class="avatar" />
|
||||
</button>
|
||||
<div v-else class="avatar fallback" v-text="avatarText" />
|
||||
@@ -14,11 +14,13 @@
|
||||
</div>
|
||||
<telephone-link class="telephone gray" :value="customerTelephone" />
|
||||
</div>
|
||||
<t-image-viewer
|
||||
v-model:visible="photoViewerVisible"
|
||||
:images="photoViewerImages"
|
||||
show-index
|
||||
/>
|
||||
<div @click.stop>
|
||||
<t-image-viewer
|
||||
v-model:visible="photoViewerVisible"
|
||||
:images="photoViewerImages"
|
||||
show-index
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -43,6 +45,11 @@ const customerTelephone = computed(() => customer.value?.telephone || "");
|
||||
const photoURL = computed(() => customer.value ? getCustomerPhotoURL(customer.value) : "");
|
||||
const photoViewerImages = computed(() => photoURL.value ? [photoURL.value] : []);
|
||||
|
||||
function handlePhotoClick(event: MouseEvent): void {
|
||||
event.stopPropagation();
|
||||
openPhotoViewer();
|
||||
}
|
||||
|
||||
function openPhotoViewer(): void {
|
||||
if (!photoURL.value) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user