diff --git a/public/sw.js b/public/sw.js index 3ec33b36..9cbb8223 100644 --- a/public/sw.js +++ b/public/sw.js @@ -62,7 +62,7 @@ const iconsRoute = new Route( cacheName: 'icons', plugins: [ new ExpirationPlugin({ - maxEntries: 50, + maxEntries: 300, maxAgeSeconds: 3 * 24 * 60 * 60, // 3 days purgeOnQuotaError: true, }), diff --git a/src/app.css b/src/app.css index b1495345..1a37f161 100644 --- a/src/app.css +++ b/src/app.css @@ -1966,6 +1966,10 @@ body > .szh-menu-container { .szh-menu .szh-menu__item.danger:not(.szh-menu__item--disabled).szh-menu__item--hover { background-color: var(--red-text-color); + + @media (prefers-color-scheme: dark) { + background-color: var(--red-color); + } } .szh-menu .szh-menu__item:not(.szh-menu__item--disabled):not( diff --git a/src/components/generic-accounts.css b/src/components/generic-accounts.css index ab82ee97..7ef1443b 100644 --- a/src/components/generic-accounts.css +++ b/src/components/generic-accounts.css @@ -17,6 +17,21 @@ ); filter: saturate(0.5); } + + &:is(a) { + pointer-events: auto; + display: block; + text-decoration: none; + color: inherit; + + &:hover { + border-color: var(--outline-hover-color); + } + + > * { + pointer-events: none; + } + } } .accounts-list { diff --git a/src/components/generic-accounts.jsx b/src/components/generic-accounts.jsx index 1b502a94..478ee403 100644 --- a/src/components/generic-accounts.jsx +++ b/src/components/generic-accounts.jsx @@ -11,6 +11,7 @@ import useLocationChange from '../utils/useLocationChange'; import AccountBlock from './account-block'; import Icon from './icon'; +import Link from './link'; import Loader from './loader'; import Status from './status'; @@ -143,9 +144,12 @@ export default function GenericAccounts({
{post && ( -
+ -
+ )} {accounts.length > 0 ? ( <> diff --git a/src/components/notification.jsx b/src/components/notification.jsx index beb2a202..d2eadfbd 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -28,6 +28,7 @@ const NOTIFICATION_ICONS = { 'admin.signup': 'account-edit', 'admin.report': 'account-warning', severed_relationships: 'heart-break', + moderation_warning: 'alert', emoji_reaction: 'emoji2', 'pleroma:emoji_reaction': 'emoji2', }; @@ -45,6 +46,8 @@ poll = A poll you have voted in or created has ended update = A status you interacted with has been edited admin.sign_up = Someone signed up (optionally sent to admins) admin.report = A new report has been filed +severed_relationships = Severed relationships +moderation_warning = Moderation warning */ function emojiText(emoji, emoji_url) { @@ -91,6 +94,7 @@ const contentText = { Lost connections with {name}. ), + moderation_warning: Moderation warning, emoji_reaction: emojiText, 'pleroma:emoji_reaction': emojiText, }; @@ -117,6 +121,17 @@ const SEVERED_RELATIONSHIPS_TEXT = { ), }; +const MODERATION_WARNING_TEXT = { + none: 'Your account has received a moderation warning.', + disable: 'Your account has been disabled.', + mark_statuses_as_sensitive: + 'Some of your posts have been marked as sensitive.', + delete_statuses: 'Some of your posts have been deleted.', + sensitive: 'Your posts will be marked as sensitive from now on.', + silence: 'Your account has been limited.', + suspend: 'Your account has been suspended.', +}; + const AVATARS_LIMIT = 50; function Notification({ @@ -125,8 +140,16 @@ function Notification({ isStatic, disableContextMenu, }) { - const { id, status, account, report, event, _accounts, _statuses } = - notification; + const { + id, + status, + account, + report, + event, + moderation_warning, + _accounts, + _statuses, + } = notification; let { type } = notification; // status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update @@ -314,6 +337,20 @@ function Notification({ . )} + {type === 'moderation_warning' && !!moderation_warning && ( +
+ {MODERATION_WARNING_TEXT[moderation_warning.action]} +
+ + Learn more + + . +
+ )} )} {_accounts?.length > 1 && ( diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index e97d8aa1..cb68d4af 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -102,6 +102,17 @@ function Notifications({ columnMode }) { // }, // }); + // TEST: Slot in a fake notification to test 'moderation_warning' + // notifications.unshift({ + // id: '123123', + // type: 'moderation_warning', + // createdAt: new Date().toISOString(), + // moderation_warning: { + // id: '1231234', + // action: 'mark_statuses_as_sensitive', + // }, + // }); + // console.log({ notifications }); const groupedNotifications = groupNotifications(notifications); diff --git a/src/utils/shorten-number.jsx b/src/utils/shorten-number.jsx index 0960ec05..80aef77b 100644 --- a/src/utils/shorten-number.jsx +++ b/src/utils/shorten-number.jsx @@ -1,5 +1,6 @@ const { locale } = Intl.NumberFormat().resolvedOptions(); const shortenNumber = Intl.NumberFormat(locale, { notation: 'compact', + roundingMode: 'floor', }).format; export default shortenNumber;