use <Name /> in more places so the verified badge is on them too.

This commit is contained in:
fiatjaf 2022-01-25 21:21:10 -03:00
parent 6e6f674665
commit fc982421ea
3 changed files with 20 additions and 17 deletions

View File

@ -1,18 +1,20 @@
<template>
<span
v-if="$store.getters.hasName(pubkey)"
class="cursor-pointer font-bold text-secondary mr-2"
@click="toProfile(pubkey)"
>
{{ $store.getters.displayName(pubkey) }}
</span>
<q-icon
v-if="$store.getters.isVerifiedNIP05(pubkey)"
name="verified"
color="accent"
class="cursor-pointer mr-1 -ml-1"
@click="openNIP05"
/>
<div class="inline-flex items-center">
<span
v-if="fallback || $store.getters.hasName(pubkey)"
class="cursor-pointer font-bold text-secondary mr-2"
@click="toProfile(pubkey)"
>
{{ $store.getters.displayName(pubkey) }}
</span>
<q-icon
v-if="$store.getters.isVerifiedNIP05(pubkey)"
name="verified"
color="accent"
class="cursor-pointer mr-1 -ml-1"
@click="openNIP05"
/>
</div>
</template>
<script>
@ -21,7 +23,8 @@ import helpersMixin from '../utils/mixin'
export default {
mixins: [helpersMixin],
props: {
pubkey: {type: String, required: true}
pubkey: {type: String, required: true},
fallback: {type: Boolean, default: false} // if the shortened pubkey should be displayed
},
methods: {
openNIP05() {

View File

@ -25,7 +25,7 @@
</q-badge>
</q-item-section>
<q-item-section>
{{ $store.getters.displayName(chat.peer) }}
<Name :pubkey="chat.peer" fallback />
</q-item-section>
<q-item-section side>
{{ niceDate(chat.lastMessage) }}

View File

@ -6,7 +6,7 @@
class="text-secondary cursor-pointer"
@click="toProfile($route.params.pubkey)"
>
{{ $store.getters.displayName($route.params.pubkey) }}
<Name :pubkey="$route.params.pubkey" fallback />
</span>
</div>