Show actor address in action tooltip

This commit is contained in:
silverpill 2022-09-28 20:33:55 +00:00
parent 3e27e59fbb
commit 0604e61561

View file

@ -7,55 +7,28 @@
:key="notification.id" :key="notification.id"
> >
<div class="action"> <div class="action">
<template v-if="notification.type === 'follow'"> <img v-if="notification.type === 'follow'" :src="require('@/assets/feather/user-plus.svg')">
<img :src="require('@/assets/feather/user-plus.svg')"> <img v-else-if="notification.type === 'reply'" :src="require('@/assets/forkawesome/comment-o.svg')">
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}"> <img v-else-if="notification.type === 'favourite'" :src="require('@/assets/forkawesome/thumbs-o-up.svg')">
{{ getSenderName(notification) }} <img v-else-if="notification.type === 'mention'" :src="require('@/assets/forkawesome/comment-o.svg')">
</router-link> <img v-else-if="notification.type === 'reblog'" :src="require('@/assets/feather/repeat.svg')">
<span>followed you</span> <img
</template> v-else-if="notification.type === 'subscription' || notification.type === 'subscription_expiration'"
<template v-else-if="notification.type === 'reply'"> :src="require('@/assets/tabler/coin.svg')"
<img :src="require('@/assets/forkawesome/comment-o.svg')"> >
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}"> <router-link
{{ getSenderName(notification) }} :title="getSenderInfo(notification)"
</router-link> :to="{ name: 'profile', params: { profileId: notification.account.id } }"
<span>replied to your post</span> >
</template> {{ getSenderName(notification) }}
<template v-else-if="notification.type === 'favourite'"> </router-link>
<img :src="require('@/assets/forkawesome/thumbs-o-up.svg')"> <span v-if="notification.type === 'follow'">followed you</span>
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}"> <span v-else-if="notification.type === 'reply'">replied to your post</span>
{{ getSenderName(notification) }} <span v-else-if="notification.type === 'favourite'">liked your post</span>
</router-link> <span v-else-if="notification.type === 'mention'">mentioned you</span>
<span>liked your post</span> <span v-else-if="notification.type === 'reblog'">reposted your post</span>
</template> <span v-else-if="notification.type === 'subscription'">paid for subscription</span>
<template v-else-if="notification.type === 'mention'"> <span v-else-if="notification.type === 'subscription_expiration'">subscription expired</span>
<img :src="require('@/assets/forkawesome/comment-o.svg')">
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}">
{{ getSenderName(notification) }}
</router-link>
<span>mentioned you</span>
</template>
<template v-else-if="notification.type === 'reblog'">
<img :src="require('@/assets/feather/repeat.svg')">
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}">
{{ getSenderName(notification) }}
</router-link>
<span>reposted your post</span>
</template>
<template v-else-if="notification.type === 'subscription'">
<img :src="require('@/assets/tabler/coin.svg')">
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}">
{{ getSenderName(notification) }}
</router-link>
<span>paid for subscription</span>
</template>
<template v-else-if="notification.type === 'subscription_expiration'">
<img :src="require('@/assets/tabler/coin.svg')">
<router-link :to="{ name: 'profile', params: { profileId: notification.account.id }}">
{{ getSenderName(notification) }}
</router-link>
<span>subscription expired</span>
</template>
</div> </div>
<post <post
v-if="notification.status" v-if="notification.status"
@ -67,7 +40,7 @@
<router-link <router-link
v-else v-else
class="profile" class="profile"
:to="{ name: 'profile', params: { profileId: notification.account.id }}" :to="{ name: 'profile', params: { profileId: notification.account.id } }"
> >
<div class="floating-avatar"> <div class="floating-avatar">
<avatar :profile="notification.account"></avatar> <avatar :profile="notification.account"></avatar>
@ -122,6 +95,10 @@ function getSenderName(notification: Notification): string {
return sender.display_name || sender.username return sender.display_name || sender.username
} }
function getSenderInfo(notification: Notification): string {
return `${getSenderName(notification)} (${getActorAddress(notification.account)})`
}
function onPostDeleted(notificationIndex: number) { function onPostDeleted(notificationIndex: number) {
notifications.value.splice(notificationIndex, 1) notifications.value.splice(notificationIndex, 1)
} }