feat: show notification timestamp (#3215)

This commit is contained in:
TAKAHASHI Shuuji 2025-03-03 01:54:35 +09:00 committed by GitHub
parent 41379627b5
commit d94b14ae53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 8 deletions

View file

@ -33,6 +33,9 @@ const unsupportedEmojiReactionTypes = ['pleroma:emoji_reaction', 'reaction']
if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotificationTypes.includes(notification.type)) {
console.warn(`[DEV] ${t('notification.missing_type')} '${notification.type}' (notification.id: ${notification.id})`)
}
const timeAgoOptions = useTimeAgoOptions(true)
const timeAgo = useTimeAgo(() => notification.createdAt, timeAgoOptions)
</script>
<template>
@ -48,7 +51,7 @@ if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotif
<div i-ri-user-3-line text-xl me-3 color-blue />
<AccountDisplayName :account="notification.account" text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all />
<span ws-nowrap>
{{ $t('notification.followed_you') }}
{{ $t('notification.followed_you') }}{{ timeAgo }}
</span>
</div>
<AccountBigCard
@ -65,7 +68,7 @@ if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotif
:account="notification.account"
text-purple me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<span>{{ $t("notification.signed_up") }}</span>
<span>{{ $t("notification.signed_up") }}{{ timeAgo }}</span>
</div>
</NuxtLink>
</template>
@ -94,7 +97,7 @@ if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotif
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<span me-1 ws-nowrap>
{{ $t('notification.request_to_follow') }}
{{ $t('notification.request_to_follow') }}{{ timeAgo }}
</span>
</div>
<AccountCard p="s-2 e-4 b-2" hover-card :account="notification.account">
@ -108,7 +111,7 @@ if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotif
<div i-ri:edit-2-fill text-xl me-1 text-secondary />
<AccountInlineInfo :account="notification.account" me1 />
<span ws-nowrap>
{{ $t('notification.update_status') }}
{{ $t('notification.update_status') }}{{ timeAgo }}
</span>
</div>
</template>