From e45623eef62b7d66f58cb0339e03fe7504c623cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 30 Jul 2022 23:31:38 +0200 Subject: [PATCH] Fix: Unable to approve follower requests from notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/account.tsx | 2 +- .../components/account_authorize.tsx | 5 ++- .../notifications/components/notification.tsx | 8 ++++ .../features/ui/components/action-button.tsx | 39 ++++++++++++++++++- 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index 5456ff6fb..fc4b290b6 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -47,7 +47,7 @@ interface IAccount { actionIcon?: string, actionTitle?: string, /** Override other actions for specificity like mute/unmute. */ - actionType?: 'muting' | 'blocking', + actionType?: 'muting' | 'blocking' | 'follow_request', avatarSize?: number, hidden?: boolean, hideActions?: boolean, diff --git a/app/soapbox/features/follow_requests/components/account_authorize.tsx b/app/soapbox/features/follow_requests/components/account_authorize.tsx index 4355b8f46..6573bbd55 100644 --- a/app/soapbox/features/follow_requests/components/account_authorize.tsx +++ b/app/soapbox/features/follow_requests/components/account_authorize.tsx @@ -7,6 +7,7 @@ import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display-name'; import IconButton from 'soapbox/components/icon_button'; import Permalink from 'soapbox/components/permalink'; +import { Text } from 'soapbox/components/ui'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; @@ -42,12 +43,12 @@ const AccountAuthorize: React.FC = ({ id }) => { return (
- +
-
+
diff --git a/app/soapbox/features/notifications/components/notification.tsx b/app/soapbox/features/notifications/components/notification.tsx index d8e02825b..f40b5e5fd 100644 --- a/app/soapbox/features/notifications/components/notification.tsx +++ b/app/soapbox/features/notifications/components/notification.tsx @@ -271,6 +271,14 @@ const Notification: React.FC = (props) => { switch (type) { case 'follow': case 'follow_request': + return account && typeof account === 'object' ? ( +