fix: make notification timestamp gray and use <time> tag (#3223)

This commit is contained in:
TAKAHASHI Shuuji 2025-03-21 02:44:25 +09:00 committed by GitHub
parent 2d4a1cfef1
commit e20815b84c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 11 deletions

View file

@ -16,7 +16,8 @@ const lang = computed(() => {
})
const timeAgoOptions = useTimeAgoOptions(true)
const timeAgo = useTimeAgo(() => follows.value[0].createdAt, timeAgoOptions)
const timeAgoCreatedAt = computed(() => follows.value[0].createdAt)
const timeAgo = useTimeAgo(() => timeAgoCreatedAt.value, timeAgoOptions)
</script>
<template>
@ -40,7 +41,10 @@ const timeAgo = useTimeAgo(() => follows.value[0].createdAt, timeAgoOptions)
:count="count - 1"
text-primary font-bold line-clamp-1 ws-pre-wrap break-all
/>
&nbsp;{{ $t('notification.followed_you') }}{{ timeAgo }}
&nbsp;{{ $t('notification.followed_you') }}
<time text-secondary :datetime="timeAgoCreatedAt">
{{ timeAgo }}
</time>
</template>
<template v-else-if="count === 1">
<NuxtLink :to="getAccountRoute(follows[0].account)">
@ -50,7 +54,10 @@ const timeAgo = useTimeAgo(() => follows.value[0].createdAt, timeAgoOptions)
/>
</NuxtLink>
<span me-1 ws-nowrap>
{{ $t('notification.followed_you') }}{{ timeAgo }}
{{ $t('notification.followed_you') }}
<time text-secondary :datetime="timeAgoCreatedAt">
{{ timeAgo }}
</time>
</span>
</template>
</div>