|
@ -9,14 +9,14 @@ |
|
|
:checked="isSelected" |
|
|
:checked="isSelected" |
|
|
class="ml-2 h-6 w-6 flex-shrink-0" |
|
|
class="ml-2 h-6 w-6 flex-shrink-0" |
|
|
data-testId="contactCheckOne" |
|
|
data-testId="contactCheckOne" |
|
|
@click="$emit('toggle-selection', contact.did)" |
|
|
@click="emitToggleSelection(contact.did)" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<EntityIcon |
|
|
<EntityIcon |
|
|
:contact="contact" |
|
|
:contact="contact" |
|
|
:icon-size="48" |
|
|
:icon-size="48" |
|
|
class="shrink-0 align-text-bottom border border-slate-300 rounded cursor-pointer overflow-hidden" |
|
|
class="shrink-0 align-text-bottom border border-slate-300 rounded cursor-pointer overflow-hidden" |
|
|
@click="$emit('show-identicon', contact)" |
|
|
@click="emitShowIdenticon(contact)" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<div class="overflow-hidden"> |
|
|
<div class="overflow-hidden"> |
|
@ -63,7 +63,7 @@ |
|
|
<button |
|
|
<button |
|
|
class="text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2.5 py-1.5 rounded-l-md" |
|
|
class="text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2.5 py-1.5 rounded-l-md" |
|
|
:title="getGiveDescriptionForContact(contact.did, true)" |
|
|
:title="getGiveDescriptionForContact(contact.did, true)" |
|
|
@click="$emit('show-gifted-dialog', contact.did, activeDid)" |
|
|
@click="emitShowGiftedDialog(contact.did, activeDid)" |
|
|
> |
|
|
> |
|
|
{{ getGiveAmountForContact(contact.did, true) }} |
|
|
{{ getGiveAmountForContact(contact.did, true) }} |
|
|
</button> |
|
|
</button> |
|
@ -71,7 +71,7 @@ |
|
|
<button |
|
|
<button |
|
|
class="text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2.5 py-1.5 rounded-r-md border-l" |
|
|
class="text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2.5 py-1.5 rounded-r-md border-l" |
|
|
:title="getGiveDescriptionForContact(contact.did, false)" |
|
|
:title="getGiveDescriptionForContact(contact.did, false)" |
|
|
@click="$emit('show-gifted-dialog', activeDid, contact.did)" |
|
|
@click="emitShowGiftedDialog(activeDid, contact.did)" |
|
|
> |
|
|
> |
|
|
{{ getGiveAmountForContact(contact.did, false) }} |
|
|
{{ getGiveAmountForContact(contact.did, false) }} |
|
|
</button> |
|
|
</button> |
|
@ -81,7 +81,7 @@ |
|
|
<button |
|
|
<button |
|
|
class="text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-1.5 rounded-md" |
|
|
class="text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-1.5 rounded-md" |
|
|
data-testId="offerButton" |
|
|
data-testId="offerButton" |
|
|
@click="$emit('open-offer-dialog', contact.did, contact.name)" |
|
|
@click="emitOpenOfferDialog(contact.did, contact.name)" |
|
|
> |
|
|
> |
|
|
Offer |
|
|
Offer |
|
|
</button> |
|
|
</button> |
|
@ -102,7 +102,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import { Component, Vue, Prop } from "vue-facing-decorator"; |
|
|
import { Component, Vue, Prop, Emit } from "vue-facing-decorator"; |
|
|
import EntityIcon from "./EntityIcon.vue"; |
|
|
import EntityIcon from "./EntityIcon.vue"; |
|
|
import { Contact } from "../db/tables/contacts"; |
|
|
import { Contact } from "../db/tables/contacts"; |
|
|
import { AppString } from "../constants/app"; |
|
|
import { AppString } from "../constants/app"; |
|
@ -140,6 +140,27 @@ export default class ContactListItem extends Vue { |
|
|
// Constants |
|
|
// Constants |
|
|
AppString = AppString; |
|
|
AppString = AppString; |
|
|
|
|
|
|
|
|
|
|
|
// Emit methods using @Emit decorator |
|
|
|
|
|
@Emit("toggle-selection") |
|
|
|
|
|
emitToggleSelection(did: string) { |
|
|
|
|
|
return did; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Emit("show-identicon") |
|
|
|
|
|
emitShowIdenticon(contact: Contact) { |
|
|
|
|
|
return contact; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Emit("show-gifted-dialog") |
|
|
|
|
|
emitShowGiftedDialog(fromDid: string, toDid: string) { |
|
|
|
|
|
return { fromDid, toDid }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Emit("open-offer-dialog") |
|
|
|
|
|
emitOpenOfferDialog(did: string, name: string | undefined) { |
|
|
|
|
|
return { did, name }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Format contact name with non-breaking spaces |
|
|
* Format contact name with non-breaking spaces |
|
|
*/ |
|
|
*/ |
|
|