From 2bbbfd51c1a9ce0267c468dfd10024c62076957b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Sat, 7 Jan 2023 03:12:00 +0800 Subject: [PATCH] refactor(account): extract display name component --- components/account/AccountBigCard.vue | 8 +------- components/account/AccountDisplayName.vue | 15 +++++++++++++++ components/account/AccountHeader.vue | 9 ++------- components/account/AccountInfo.vue | 6 +----- components/account/AccountInlineInfo.vue | 6 +----- components/notification/NotificationCard.vue | 11 +++-------- .../notification/NotificationGroupedFollow.vue | 5 ++--- components/search/SearchAccountInfo.vue | 6 +----- components/status/StatusAccountDetails.vue | 6 +----- 9 files changed, 27 insertions(+), 45 deletions(-) create mode 100644 components/account/AccountDisplayName.vue diff --git a/components/account/AccountBigCard.vue b/components/account/AccountBigCard.vue index fb7f852e..caaf3ba0 100644 --- a/components/account/AccountBigCard.vue +++ b/components/account/AccountBigCard.vue @@ -32,13 +32,7 @@ defineOptions({
-
- -
+
diff --git a/components/account/AccountDisplayName.vue b/components/account/AccountDisplayName.vue new file mode 100644 index 00000000..a8b8befc --- /dev/null +++ b/components/account/AccountDisplayName.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index f048ddc0..870da89d 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -73,14 +73,9 @@ const isSelf = $computed(() => currentUser.value?.account.id === account.id) -
+
- +
diff --git a/components/account/AccountInfo.vue b/components/account/AccountInfo.vue index bb97a95a..564b5437 100644 --- a/components/account/AccountInfo.vue +++ b/components/account/AccountInfo.vue @@ -22,11 +22,7 @@ defineOptions({
- +
diff --git a/components/account/AccountInlineInfo.vue b/components/account/AccountInlineInfo.vue index d82f4d69..d5422d5b 100644 --- a/components/account/AccountInlineInfo.vue +++ b/components/account/AccountInlineInfo.vue @@ -16,11 +16,7 @@ const { link = true, avatar = true } = defineProps<{ min-w-0 flex gap-2 items-center > - + diff --git a/components/notification/NotificationCard.vue b/components/notification/NotificationCard.vue index 00f3e815..1c5d540e 100644 --- a/components/notification/NotificationCard.vue +++ b/components/notification/NotificationCard.vue @@ -18,11 +18,7 @@ const { notification } = defineProps<{ :lang="notification.status?.language ?? undefined" >
- + {{ $t('notification.followed_you') }} @@ -36,10 +32,9 @@ const { notification } = defineProps<{