Browse Source

Icon for hidden DID entity

- Display EntityIcon for known entities, eye-slash icon for hidden entities, and the person-question icon for unknown entities
- Design tweaks (spacings, mostly)
home-icon-enhancements
Jose Olarte III 6 days ago
parent
commit
706182ca0c
  1. 47
      src/components/ActivityListItem.vue

47
src/components/ActivityListItem.vue

@ -14,22 +14,27 @@
class="flex items-center justify-between gap-2 text-lg bg-slate-200 border border-slate-300 border-b-0 rounded-t-md px-3 sm:px-4 py-1 sm:py-2" class="flex items-center justify-between gap-2 text-lg bg-slate-200 border border-slate-300 border-b-0 rounded-t-md px-3 sm:px-4 py-1 sm:py-2"
> >
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<div v-if="record.issuerDid">
<EntityIcon <EntityIcon
v-if="record.issuerDid && !isHiddenDid(record.issuerDid)"
:entity-id="record.issuerDid" :entity-id="record.issuerDid"
class="rounded-full bg-white overflow-hidden !size-[2rem] object-cover" class="rounded-full bg-white overflow-hidden !size-[2rem] object-cover"
/> />
</div>
<div v-else>
<font-awesome <font-awesome
v-else-if="isHiddenDid(record.issuerDid)"
icon="eye-slash"
class="text-slate-400 !size-[2rem]"
/>
<font-awesome v-else
icon="person-circle-question" icon="person-circle-question"
class="text-slate-300 text-[2rem]" class="text-slate-400 !size-[2rem]"
/> />
</div>
<div> <div>
<h3 class="font-semibold"> <h3
{{ record.issuer.known ? record.issuer.displayName : "" }} v-if="record.issuer.known"
class="font-semibold leading-tight"
>
{{ record.issuer.displayName }}
</h3> </h3>
<p class="ms-auto text-xs text-slate-500 italic"> <p class="ms-auto text-xs text-slate-500 italic">
{{ friendlyDate }} {{ friendlyDate }}
@ -46,7 +51,7 @@
<!-- Record Image --> <!-- Record Image -->
<div <div
v-if="record.image" v-if="record.image"
class="bg-cover mb-6 -mt-3 sm:-mt-4 -mx-3 sm:-mx-4" class="bg-cover mb-4 -mt-3 sm:-mt-4 -mx-3 sm:-mx-4"
:style="`background-image: url(${record.image});`" :style="`background-image: url(${record.image});`"
> >
<a <a
@ -63,11 +68,11 @@
</div> </div>
<div <div
class="relative flex justify-between gap-4 max-w-[40rem] mx-auto mb-5" class="relative flex justify-between gap-4 max-w-[40rem] mx-auto mb-3"
> >
<!-- Source --> <!-- Source -->
<div <div
class="w-[8rem] sm:w-[12rem] text-center bg-white border border-slate-200 rounded p-2 sm:p-3" class="w-[7rem] sm:w-[12rem] text-center bg-white border border-slate-200 rounded p-2 sm:p-3"
> >
<div class="relative w-fit mx-auto"> <div class="relative w-fit mx-auto">
<div> <div>
@ -82,10 +87,16 @@
<!-- Identicon for DIDs --> <!-- Identicon for DIDs -->
<div v-else-if="record.agentDid"> <div v-else-if="record.agentDid">
<EntityIcon <EntityIcon
v-if="!isHiddenDid(record.agentDid)"
:entity-id="record.agentDid" :entity-id="record.agentDid"
:profile-image-url="record.issuer.profileImageUrl" :profile-image-url="record.issuer.profileImageUrl"
class="rounded-full bg-slate-100 overflow-hidden !size-[3rem] sm:!size-[4rem]" class="rounded-full bg-slate-100 overflow-hidden !size-[3rem] sm:!size-[4rem]"
/> />
<font-awesome
v-else
icon="eye-slash"
class="text-slate-300 !size-[3rem] sm:!size-[4rem]"
/>
</div> </div>
<!-- Unknown Person --> <!-- Unknown Person -->
<div v-else> <div v-else>
@ -110,9 +121,9 @@
<!-- Arrow --> <!-- Arrow -->
<div <div
class="absolute inset-x-[8rem] sm:inset-x-[12rem] mx-2 top-1/2 -translate-y-1/2" class="absolute inset-x-[7rem] sm:inset-x-[12rem] mx-2 top-1/2 -translate-y-1/2"
> >
<div class="text-sm text-center leading-none font-semibold pe-[15px]"> <div class="text-sm text-center leading-none font-semibold pe-2 sm:pe-4">
{{ fetchAmount }} {{ fetchAmount }}
</div> </div>
@ -129,7 +140,7 @@
<!-- Destination --> <!-- Destination -->
<div <div
class="w-[8rem] sm:w-[12rem] text-center bg-white border border-slate-200 rounded p-2 sm:p-3" class="w-[7rem] sm:w-[12rem] text-center bg-white border border-slate-200 rounded p-2 sm:p-3"
> >
<div class="relative w-fit mx-auto"> <div class="relative w-fit mx-auto">
<div> <div>
@ -144,10 +155,16 @@
<!-- Identicon for DIDs --> <!-- Identicon for DIDs -->
<div v-else-if="record.recipientDid"> <div v-else-if="record.recipientDid">
<EntityIcon <EntityIcon
v-if="!isHiddenDid(record.recipientDid)"
:entity-id="record.recipientDid" :entity-id="record.recipientDid"
:profile-image-url="record.receiver.profileImageUrl" :profile-image-url="record.receiver.profileImageUrl"
class="rounded-full bg-slate-100 overflow-hidden !size-[3rem] sm:!size-[4rem]" class="rounded-full bg-slate-100 overflow-hidden !size-[3rem] sm:!size-[4rem]"
/> />
<font-awesome
v-else
icon="eye-slash"
class="text-slate-300 !size-[3rem] sm:!size-[4rem]"
/>
</div> </div>
<!-- Unknown Person --> <!-- Unknown Person -->
<div v-else> <div v-else>
@ -186,7 +203,7 @@ import { Component, Prop, Vue, Emit } from "vue-facing-decorator";
import { GiveRecordWithContactInfo } from "../types"; import { GiveRecordWithContactInfo } from "../types";
import EntityIcon from "./EntityIcon.vue"; import EntityIcon from "./EntityIcon.vue";
import { isGiveClaimType, notifyWhyCannotConfirm } from "../libs/util"; import { isGiveClaimType, notifyWhyCannotConfirm } from "../libs/util";
import { containsHiddenDid } from "../libs/endorserServer"; import { containsHiddenDid, isHiddenDid } from "../libs/endorserServer";
import ProjectIcon from "./ProjectIcon.vue"; import ProjectIcon from "./ProjectIcon.vue";
@Component({ @Component({
@ -202,6 +219,8 @@ export default class ActivityListItem extends Vue {
@Prop() activeDid!: string; @Prop() activeDid!: string;
@Prop() confirmerIdList?: string[]; @Prop() confirmerIdList?: string[];
isHiddenDid = isHiddenDid;
@Emit() @Emit()
cacheImage(image: string) { cacheImage(image: string) {
return image; return image;

Loading…
Cancel
Save