Update copies for severed relationships

Ref: https://github.com/mastodon/mastodon/pull/29731
This commit is contained in:
Lim Chee Aun 2024-03-26 19:47:03 +08:00
parent 67a05450cf
commit d671178c02
2 changed files with 40 additions and 42 deletions

View file

@ -106,5 +106,5 @@ export const ICONS = {
copy: () => import('@iconify-icons/mingcute/copy-2-line'), copy: () => import('@iconify-icons/mingcute/copy-2-line'),
quote: () => import('@iconify-icons/mingcute/quote-left-line'), quote: () => import('@iconify-icons/mingcute/quote-left-line'),
settings: () => import('@iconify-icons/mingcute/settings-6-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'),
}; };

View file

@ -26,7 +26,7 @@ const NOTIFICATION_ICONS = {
update: 'pencil', update: 'pencil',
'admin.signup': 'account-edit', 'admin.signup': 'account-edit',
'admin.report': 'account-warning', 'admin.report': 'account-warning',
severed_relationships: 'unlink', severed_relationships: 'heart-break',
emoji_reaction: 'emoji2', emoji_reaction: 'emoji2',
'pleroma:emoji_reaction': 'emoji2', 'pleroma:emoji_reaction': 'emoji2',
}; };
@ -85,16 +85,35 @@ const contentText = {
'favourite+reblog_reply': 'boosted & liked your reply.', 'favourite+reblog_reply': 'boosted & liked your reply.',
'admin.sign_up': 'signed up.', 'admin.sign_up': 'signed up.',
'admin.report': (targetAccount) => <>reported {targetAccount}</>, 'admin.report': (targetAccount) => <>reported {targetAccount}</>,
severed_relationships: (name) => `Relationships with ${name} severed.`, severed_relationships: (name) => (
<>
Lost connections with <i>{name}</i>.
</>
),
emoji_reaction: emojiText, emoji_reaction: emojiText,
'pleroma:emoji_reaction': emojiText, 'pleroma:emoji_reaction': emojiText,
}; };
// account_suspension, domain_block, user_domain_block // account_suspension, domain_block, user_domain_block
const SEVERED_RELATIONSHIPS_TEXT = { const SEVERED_RELATIONSHIPS_TEXT = {
account_suspension: 'Account has been suspended.', account_suspension: ({ from, targetName }) => (
domain_block: 'Domain has been blocked.', <>
user_domain_block: 'You blocked this domain.', 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; const AVATARS_LIMIT = 50;
@ -277,42 +296,21 @@ function Notification({
<FollowRequestButtons accountID={account.id} /> <FollowRequestButtons accountID={account.id} />
)} )}
{type === 'severed_relationships' && ( {type === 'severed_relationships' && (
<> <div>
<p> {SEVERED_RELATIONSHIPS_TEXT[event.type]({
<span class="insignificant"> from: instance,
{event?.purge ? ( ...event,
'Purged by administrators.' })}
) : ( <br />
<> <a
{event.relationshipsCount} relationship href={`https://${instance}/severed_relationships`}
{event.relationshipsCount === 1 ? '' : 's'} target="_blank"
{!!event.createdAt && ( rel="noopener noreferrer"
<> >
{' '} Learn more <Icon icon="external" size="s" />
{' '} </a>
<RelativeTime .
datetime={event.createdAt} </div>
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>
</>
)} )}
</> </>
)} )}