From a7d64fd1329c6299799487f20f3783598a774460 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 25 Jan 2025 00:21:57 +0900 Subject: [PATCH] feat: bluesky-style follow notification (#3151) --- .../NotificationGroupedFollow.vue | 73 ++++++++++++++----- locales/en.json | 2 + 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/components/notification/NotificationGroupedFollow.vue b/components/notification/NotificationGroupedFollow.vue index 138f05e4..d0cfa4c5 100644 --- a/components/notification/NotificationGroupedFollow.vue +++ b/components/notification/NotificationGroupedFollow.vue @@ -5,7 +5,11 @@ const { items } = defineProps<{ items: GroupedNotifications }>() -const count = computed(() => items.items.length) +const maxVisibleFollows = 5 +const follows = computed(() => items.items) +const visibleFollows = computed(() => follows.value.slice(0, maxVisibleFollows)) +const count = computed(() => follows.value.length) +const countPlus = computed(() => Math.max(count.value - maxVisibleFollows, 0)) const isExpanded = ref(false) const lang = computed(() => { return (count.value > 1 || count.value === 0) ? undefined : items.items[0].status?.language @@ -17,16 +21,29 @@ const lang = computed(() => {
-
- -
-
+
- - + + + + +
+ +{{ countPlus }} + +
+
+
+ + + + +
diff --git a/locales/en.json b/locales/en.json index 20520aa0..eb1a3443 100644 --- a/locales/en.json +++ b/locales/en.json @@ -334,10 +334,12 @@ "zen_mode": "Zen Mode" }, "notification": { + "and": "and", "favourited_post": "favorited your post", "followed_you": "followed you", "followed_you_count": "{0} people followed you|{0} person followed you|{0} people followed you", "missing_type": "MISSING notification.type:", + "others": "{0} others|{0} other|{0} others", "reblogged_post": "boosted your post", "reported": "{0} reported {1}", "request_to_follow": "requested to follow you",