pl-fe: add relationship button to follow notifications

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2025-03-02 17:59:31 +01:00
parent 2a5106fb1f
commit 70848bab95
2 changed files with 14 additions and 7 deletions

View File

@ -333,26 +333,33 @@ const Notification: React.FC<INotification> = (props) => {
const renderContent = () => {
switch (type) {
case 'follow':
return (
<AccountContainer
id={account.id}
avatarSize={avatarSize}
withRelationship
/>
);
case 'follow_request':
return account && typeof account === 'object' ? (
return (
<AccountContainer
id={account.id}
avatarSize={avatarSize}
actionType='follow_request'
withRelationship
/>
) : null;
);
case 'bite':
return account && typeof account === 'object' ? (
return (
<AccountContainer
id={account.id}
avatarSize={avatarSize}
actionType='biting'
withRelationship
/>
) : null;
);
case 'move':
return account && typeof account === 'object' && notification.target && typeof notification.target === 'object' ? (
return notification.target ? (
<AccountContainer
id={notification.target_id}
avatarSize={avatarSize}
@ -369,7 +376,7 @@ const Notification: React.FC<INotification> = (props) => {
case 'event_reminder':
case 'participation_accepted':
case 'participation_request':
return status && typeof status === 'object' ? (
return status ? (
<StatusContainer
id={status.id}
onMoveDown={handleMoveDown}

View File

@ -231,7 +231,7 @@ const ActionButton: React.FC<IActionButton> = ({ 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();