Skip to content

Commit

Permalink
fix(ux): contact picture buttons and labels
Browse files Browse the repository at this point in the history
frappe#1354
- Do not show "Change Photo" when there is no photo updated
- Do not show "Remove" when there is no photo updated. Only show this if there is a photo is updated
  • Loading branch information
ssiyad committed Jul 26, 2023
1 parent 70a6a13 commit 14a635b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions desk/src/pages/desk/contact/ContactDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
<FileUploader @success="(file) => updateImage(file)">
<template #default="{ uploading, openFileSelector }">
<Button
label="Change photo"
:label="contact.doc?.image ? 'Change photo' : 'Upload photo'"
:loading="uploading"
@click="openFileSelector"
/>
</template>
</FileUploader>
<Button label="Remove photo" @click="updateImage(null)" />
<Button
v-if="contact.doc?.image"
label="Remove photo"
@click="updateImage(null)"
/>
</div>
<div class="w-full space-y-2 text-sm text-gray-700">
<div class="space-y-1">
Expand Down

0 comments on commit 14a635b

Please sign in to comment.