Browse Source

modify & explain icons next to feed

pull/120/head
Trent Larson 5 months ago
committed by Gitea
parent
commit
1c0e0aeeba
  1. 4
      src/libs/endorserServer.ts
  2. 8
      src/views/DiscoverView.vue
  3. 32
      src/views/HomeView.vue

4
src/libs/endorserServer.ts

@ -407,7 +407,7 @@ export function contactForDid(
* @param contact
* @param allMyDids
* @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"
* where 'known' is true if they are in the contacts
*/
export function didInfoForContact(
did: string | undefined,
@ -422,7 +422,7 @@ export function didInfoForContact(
} else if (contact) {
return {
displayName: contact.name || "Contact With No Name",
known: !!contact.name,
known: !!contact,
profileImageUrl: contact.profileImageUrl,
};
} else {

8
src/views/DiscoverView.vue

@ -37,7 +37,7 @@
isRemoteActive = false;
searchLocal();
"
v-bind:class="computedLocalTabClassNames()"
v-bind:class="computedLocalTabStyleClassNames()"
>
Nearby
<span
@ -57,7 +57,7 @@
isLocalActive = false;
searchAll();
"
v-bind:class="computedRemoteTabClassNames()"
v-bind:class="computedRemoteTabStyleClassNames()"
>
Anywhere
<span
@ -422,7 +422,7 @@ export default class DiscoverView extends Vue {
this.$router.push(route);
}
public computedLocalTabClassNames() {
public computedLocalTabStyleClassNames() {
return {
"inline-block": true,
"py-3": true,
@ -440,7 +440,7 @@ export default class DiscoverView extends Vue {
};
}
public computedRemoteTabClassNames() {
public computedRemoteTabStyleClassNames() {
return {
"inline-block": true,
"py-3": true,

32
src/views/HomeView.vue

@ -207,14 +207,22 @@
</div>
<div class="grid grid-cols-12">
<span class="col-span-1 justify-self-start">
<span class="pt-1 col-span-1 justify-self-start">
<span>
<fa
v-if="record.giver.known || record.receiver.known"
icon="circle-user"
class="pt-1 text-slate-500"
:class="
computeKnownPersonIconStyleClassNames(
record.giver.known || record.receiver.known,
)
"
@click="toastUser('This involves your contacts.')"
/>
<fa
icon="gift"
class="pl-3 text-slate-500"
@click="toastUser('This is a gift.')"
/>
<fa v-else icon="gift" class="pt-1 pl-3 text-slate-500" />
</span>
</span>
<span class="col-span-10 justify-self-stretch">
@ -765,5 +773,21 @@ export default class HomeView extends Vue {
openFeedFilters() {
(this.$refs.feedFilters as FeedFilters).open(this.reloadFeedOnChange);
}
toastUser(message) {
this.$notify(
{
group: "alert",
type: "toast",
title: "FYI",
text: message,
},
2000,
);
}
computeKnownPersonIconStyleClassNames(known: boolean) {
return known ? "text-slate-500" : "text-slate-100";
}
}
</script>

Loading…
Cancel
Save