From 70848bab95049761fd0913761d4cd650b6a19e34 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Sun, 2 Mar 2025 17:59:31 +0100 Subject: [PATCH] pl-fe: add relationship button to follow notifications Signed-off-by: mkljczk --- .../notifications/components/notification.tsx | 19 +++++++++++++------ .../features/ui/components/action-button.tsx | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/pl-fe/src/features/notifications/components/notification.tsx b/packages/pl-fe/src/features/notifications/components/notification.tsx index 280cf0264..eb45b271f 100644 --- a/packages/pl-fe/src/features/notifications/components/notification.tsx +++ b/packages/pl-fe/src/features/notifications/components/notification.tsx @@ -333,26 +333,33 @@ const Notification: React.FC = (props) => { const renderContent = () => { switch (type) { case 'follow': + return ( + + ); case 'follow_request': - return account && typeof account === 'object' ? ( + return ( - ) : null; + ); case 'bite': - return account && typeof account === 'object' ? ( + return ( - ) : null; + ); case 'move': - return account && typeof account === 'object' && notification.target && typeof notification.target === 'object' ? ( + return notification.target ? ( = (props) => { case 'event_reminder': case 'participation_accepted': case 'participation_request': - return status && typeof status === 'object' ? ( + return status ? ( = ({ account, actionType, small }) = return mutingAction(); } else if (actionType === 'blocking') { return blockingAction(); - } else if (actionType === 'follow_request') { + } else if (actionType === 'follow_request' && !account.relationship?.followed_by) { return followRequestAction(); } else if (actionType === 'biting') { return bitingAction();