Remove "View other collections from this user" from collection menu (#38728)

This commit is contained in:
diondiondion 2026-04-17 10:50:35 +02:00 committed by GitHub
parent 3411d06f9e
commit e571994b5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 27 deletions

View File

@ -2,8 +2,6 @@ import { useCallback, useMemo } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { matchPath } from 'react-router';
import { showAlert } from '@/mastodon/actions/alerts';
import { initBlockModal } from '@/mastodon/actions/blocks';
import { useAccount } from '@/mastodon/hooks/useAccount';
@ -35,10 +33,6 @@ const messages = defineMessages({
id: 'collections.copy_link_confirmation',
defaultMessage: 'Copied collection link to clipboard',
},
viewOtherCollections: {
id: 'collections.view_other_collections_by_user',
defaultMessage: 'View other collections by this user',
},
delete: {
id: 'collections.delete_collection',
defaultMessage: 'Delete collection',
@ -168,25 +162,11 @@ export const CollectionMenu: React.FC<{
return ownerItems;
}
} else {
const nonOwnerItems: MenuItem[] = [viewCollectionItem, ...shareItems];
if (context !== 'notifications' && ownerAccount) {
const featuredCollectionsPath = `/@${ownerAccount.acct}/featured`;
// Don't show menu link to featured collections while on that very page
if (
!matchPath(location.pathname, {
path: featuredCollectionsPath,
exact: true,
})
) {
nonOwnerItems.push({
text: intl.formatMessage(messages.viewOtherCollections),
to: featuredCollectionsPath,
});
}
}
nonOwnerItems.push(null);
const nonOwnerItems: MenuItem[] = [
viewCollectionItem,
...shareItems,
null,
];
// Collection notifications already have a prominent 'Remove me' button
if (currentAccountInCollection && context !== 'notifications') {
@ -218,7 +198,6 @@ export const CollectionMenu: React.FC<{
dispatch,
openDeleteConfirmation,
context,
ownerAccount,
currentAccountInCollection,
openReportModal,
openBlockModal,

View File

@ -415,7 +415,6 @@
"collections.unlisted_collections_description": "These dont appear on your profile to others. Anyone with the link can discover them.",
"collections.unlisted_collections_with_count": "Unlisted collections ({count})",
"collections.view_collection": "View collection",
"collections.view_other_collections_by_user": "View other collections by this user",
"collections.visibility_public": "Public",
"collections.visibility_public_hint": "Discoverable in search results and other areas where recommendations appear.",
"collections.visibility_title": "Visibility",