From 676882978a04b28879803e5d0a4701613ae37d9b Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 20 Apr 2024 19:53:11 -0600 Subject: [PATCH] add code to display profiles in feed, but deactivate it for now --- src/components/EntityIcon.vue | 5 ++++- src/libs/endorserServer.ts | 14 ++++++------ src/main.ts | 2 ++ src/views/AccountViewView.vue | 2 +- src/views/ContactGiftingView.vue | 2 +- src/views/HomeView.vue | 37 +++++++++++++++++++++++++++++++- src/views/ProjectViewView.vue | 2 +- 7 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/components/EntityIcon.vue b/src/components/EntityIcon.vue index b14be8452..ce6f9cf23 100644 --- a/src/components/EntityIcon.vue +++ b/src/components/EntityIcon.vue @@ -17,9 +17,12 @@ export default class EntityIcon extends Vue { generateIcon() { const imageUrl = this.contact?.profileImageUrl || this.profileImageUrl; if (imageUrl) { - return `avatar`; + return ``; } else { const identifier = this.contact?.did || this.entityId; + if (!identifier) { + return ``; + } const options: StyleOptions = { seed: (identifier as string) || "", size: this.iconSize, diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index c4ba2f30e..65371ef87 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -394,7 +394,8 @@ export function contactForDid( * @param activeDid * @param contact * @param allMyDids - * @return { known: boolean, displayName: string } where known is true if the display name is some easily-recogizable name, false if it's a generic name like "Someone Anonymous" + * @return { known: boolean, displayName: string, profileImageUrl?: string } + * where 'known' is true if the display name is some easily-recogizable name, false if it's a generic name like "Someone Unnamed" */ export function didInfoForContact( did: string | undefined, @@ -402,15 +403,16 @@ export function didInfoForContact( contact?: Contact, allMyDids: string[] = [], // eslint-disable-next-line @typescript-eslint/no-explicit-any -): { known: boolean; displayName: string } { - if (!did) return { displayName: "Someone Anonymous", known: false }; - if (contact) { +): { known: boolean; displayName: string; profileImageUrl?: string } { + if (!did) return { displayName: "Someone Unnamed/Unknown", known: false }; + if (did === activeDid) { + return { displayName: "You", known: true }; + } else if (contact) { return { displayName: contact.name || "Contact With No Name", known: !!contact.name, + profileImageUrl: contact.profileImageUrl, }; - } else if (did === activeDid) { - return { displayName: "You", known: true }; } else { const myId = R.find(R.equals(did), allMyDids); return myId diff --git a/src/main.ts b/src/main.ts index 9d5c93516..c4a23369b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,6 +34,7 @@ import { faComment, faCopy, faDollar, + faEllipsis, faEllipsisVertical, faEye, faEyeSlash, @@ -97,6 +98,7 @@ library.add( faComment, faCopy, faDollar, + faEllipsis, faEllipsisVertical, faEye, faEyeSlash, diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 019794134..482c718f9 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -104,7 +104,7 @@
- ... and those without your image see this: + ... and those without your image see this (if you let them see your activity):
- Anonymous/Unnamed + Unnamed/Unknown