refactor(account): extract display name component
This commit is contained in:
parent
c7756add7d
commit
2bbbfd51c1
9 changed files with 27 additions and 45 deletions
|
@ -18,11 +18,7 @@ const { notification } = defineProps<{
|
|||
:lang="notification.status?.language ?? undefined"
|
||||
>
|
||||
<div i-ri:user-follow-fill me-1 color-primary />
|
||||
<ContentRich
|
||||
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all
|
||||
:content="getDisplayName(notification.account, { rich: true })"
|
||||
:emojis="notification.account.emojis"
|
||||
/>
|
||||
<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') }}
|
||||
</span>
|
||||
|
@ -36,10 +32,9 @@ const { notification } = defineProps<{
|
|||
<template v-else-if="notification.type === 'admin.sign_up'">
|
||||
<div flex p3 items-center bg-shaded>
|
||||
<div i-ri:admin-fill me-1 color-purple />
|
||||
<ContentRich
|
||||
<AccountDisplayName
|
||||
:account="notification.account"
|
||||
text-purple me-1 font-bold line-clamp-1 ws-pre-wrap break-all
|
||||
:content="getDisplayName(notification.account, { rich: true })"
|
||||
:emojis="notification.account.emojis"
|
||||
/>
|
||||
<span>{{ $t("notification.signed_up") }}</span>
|
||||
</div>
|
||||
|
|
|
@ -35,10 +35,9 @@ const lang = $computed(() => {
|
|||
</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<ContentRich
|
||||
<AccountDisplayName
|
||||
:account="items.items[0]?.account"
|
||||
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all
|
||||
:content="getDisplayName(items.items[0]?.account, { rich: true })"
|
||||
:emojis="items.items[0]?.account.emojis"
|
||||
/>
|
||||
<span me-1 ws-nowrap>
|
||||
{{ $t('notification.followed_you') }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue