From 5fceb709719f1733b5fdd48eaa4a429d553ce26d Mon Sep 17 00:00:00 2001
From: Sma11X <540351143@qq.com>
Date: Mon, 23 Oct 2023 00:11:00 +0800
Subject: [PATCH] feat: handle follow request (#2339)
---
components/account/AccountCard.vue | 8 ++-
.../account/AccountFollowRequestButton.vue | 68 +++++++++++++++++++
components/account/AccountHeader.vue | 4 ++
components/notification/NotificationCard.vue | 17 +++--
locales/en.json | 5 ++
locales/zh-CN.json | 5 ++
6 files changed, 99 insertions(+), 8 deletions(-)
create mode 100644 components/account/AccountFollowRequestButton.vue
diff --git a/components/account/AccountCard.vue b/components/account/AccountCard.vue
index eae4f11e..46b0a22d 100644
--- a/components/account/AccountCard.vue
+++ b/components/account/AccountCard.vue
@@ -19,8 +19,10 @@ cacheAccount(account)
overflow-hidden
:to="getAccountRoute(account)"
/>
-
+
+
+
diff --git a/components/account/AccountFollowRequestButton.vue b/components/account/AccountFollowRequestButton.vue
new file mode 100644
index 00000000..61cab918
--- /dev/null
+++ b/components/account/AccountFollowRequestButton.vue
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ relationship?.followedBy ? $t('account.authorized') : $t('account.rejected') }}
+
+
+
+
diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue
index 471e4458..b9534fbd 100644
--- a/components/account/AccountHeader.vue
+++ b/components/account/AccountHeader.vue
@@ -109,6 +109,10 @@ const personalNoteMaxLength = 2000
+
+
{{ $t('account.requested', [account.displayName]) }}
+
+
diff --git a/components/notification/NotificationCard.vue b/components/notification/NotificationCard.vue
index 59975b2e..7fd43257 100644
--- a/components/notification/NotificationCard.vue
+++ b/components/notification/NotificationCard.vue
@@ -60,12 +60,19 @@ const { notification } = defineProps<{
-
-
-
+
+
+
+
+ {{ $t('notification.request_to_follow') }}
+
-
-
+
+
+
diff --git a/locales/en.json b/locales/en.json
index bff1fb47..b8f94140 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -7,6 +7,8 @@
"route_loaded": "Page {0} loaded"
},
"account": {
+ "authorize": "Authorize to follow",
+ "authorized": "You have Authorized the request",
"avatar_description": "{0}'s avatar",
"blocked_by": "You're blocked by this user.",
"blocked_domains": "Blocked domains",
@@ -36,7 +38,10 @@
"profile_description": "{0}'s profile header",
"profile_personal_note": "Personal Note",
"profile_unavailable": "Profile unavailable",
+ "reject": "Reject to follow",
+ "rejected": "You have rejected the request",
"request_follow": "Request to follow",
+ "requested": "{0} has requested to follow you",
"unblock": "Unblock",
"unfollow": "Unfollow",
"unmute": "Unmute",
diff --git a/locales/zh-CN.json b/locales/zh-CN.json
index 68e347b1..8dc3a08e 100644
--- a/locales/zh-CN.json
+++ b/locales/zh-CN.json
@@ -7,6 +7,8 @@
"route_loaded": "页面{0}已加载"
},
"account": {
+ "authorize": "同意关注请求",
+ "authorized": "你同意了关注请求",
"avatar_description": "{0} 的头像",
"blocked_by": "您已被此用户拉黑",
"blocked_domains": "已拉黑的域名",
@@ -36,7 +38,10 @@
"profile_description": "{0} 的个人资料头图",
"profile_personal_note": "私人备注",
"profile_unavailable": "个人资料不可见",
+ "reject": "拒绝关注请求",
+ "rejected": "你拒绝了关注请求",
"request_follow": "请求关注",
+ "requested": "{0} 向你发送了关注请求",
"unblock": "取消拉黑",
"unfollow": "取消关注",
"unmute": "取消屏蔽",