Skip to content

Commit

Permalink
Update copies for severed relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Mar 26, 2024
1 parent 67a0545 commit d671178
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/components/ICONS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ export const ICONS = {
copy: () => import('@iconify-icons/mingcute/copy-2-line'),
quote: () => import('@iconify-icons/mingcute/quote-left-line'),
settings: () => import('@iconify-icons/mingcute/settings-6-line'),
unlink: () => import('@iconify-icons/mingcute/unlink-line'),
'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'),
};
80 changes: 39 additions & 41 deletions src/components/notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const NOTIFICATION_ICONS = {
update: 'pencil',
'admin.signup': 'account-edit',
'admin.report': 'account-warning',
severed_relationships: 'unlink',
severed_relationships: 'heart-break',
emoji_reaction: 'emoji2',
'pleroma:emoji_reaction': 'emoji2',
};
Expand Down Expand Up @@ -85,16 +85,35 @@ const contentText = {
'favourite+reblog_reply': 'boosted & liked your reply.',
'admin.sign_up': 'signed up.',
'admin.report': (targetAccount) => <>reported {targetAccount}</>,
severed_relationships: (name) => `Relationships with ${name} severed.`,
severed_relationships: (name) => (
<>
Lost connections with <i>{name}</i>.
</>
),
emoji_reaction: emojiText,
'pleroma:emoji_reaction': emojiText,
};

// account_suspension, domain_block, user_domain_block
const SEVERED_RELATIONSHIPS_TEXT = {
account_suspension: 'Account has been suspended.',
domain_block: 'Domain has been blocked.',
user_domain_block: 'You blocked this domain.',
account_suspension: ({ from, targetName }) => (
<>
An admin from <i>{from}</i> has suspended <i>{targetName}</i>, which means
you can no longer receive updates from them or interact with them.
</>
),
domain_block: ({ from, targetName, followersCount, followingCount }) => (
<>
An admin from <i>{from}</i> has blocked <i>{targetName}</i>. Affected
followers: {followersCount}, followings: {followingCount}.
</>
),
user_domain_block: ({ targetName, followersCount, followingCount }) => (
<>
You have blocked <i>{targetName}</i>. Removed followers: {followersCount},
followings: {followingCount}.
</>
),
};

const AVATARS_LIMIT = 50;
Expand Down Expand Up @@ -277,42 +296,21 @@ function Notification({
<FollowRequestButtons accountID={account.id} />
)}
{type === 'severed_relationships' && (
<>
<p>
<span class="insignificant">
{event?.purge ? (
'Purged by administrators.'
) : (
<>
{event.relationshipsCount} relationship
{event.relationshipsCount === 1 ? '' : 's'}
{!!event.createdAt && (
<>
{' '}
{' '}
<RelativeTime
datetime={event.createdAt}
format="micro"
/>
</>
)}
</>
)}
</span>
<br />
<b>{SEVERED_RELATIONSHIPS_TEXT[event.type]}</b>
</p>
<p>
<a
href={`https://${instance}/severed_relationships`}
class="button plain6"
target="_blank"
rel="noopener noreferrer"
>
<span>View</span> <Icon icon="external" />
</a>
</p>
</>
<div>
{SEVERED_RELATIONSHIPS_TEXT[event.type]({
from: instance,
...event,
})}
<br />
<a
href={`https://${instance}/severed_relationships`}
target="_blank"
rel="noopener noreferrer"
>
Learn more <Icon icon="external" size="s" />
</a>
.
</div>
)}
</>
)}
Expand Down

0 comments on commit d671178

Please sign in to comment.