Remove "View other collections from this user" from collection menu (#38728)
This commit is contained in:
parent
3411d06f9e
commit
e571994b5c
@ -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,
|
||||
|
||||
@ -415,7 +415,6 @@
|
||||
"collections.unlisted_collections_description": "These don’t 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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user