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 { defineMessages, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { matchPath } from 'react-router';
|
|
||||||
|
|
||||||
import { showAlert } from '@/mastodon/actions/alerts';
|
import { showAlert } from '@/mastodon/actions/alerts';
|
||||||
import { initBlockModal } from '@/mastodon/actions/blocks';
|
import { initBlockModal } from '@/mastodon/actions/blocks';
|
||||||
import { useAccount } from '@/mastodon/hooks/useAccount';
|
import { useAccount } from '@/mastodon/hooks/useAccount';
|
||||||
@ -35,10 +33,6 @@ const messages = defineMessages({
|
|||||||
id: 'collections.copy_link_confirmation',
|
id: 'collections.copy_link_confirmation',
|
||||||
defaultMessage: 'Copied collection link to clipboard',
|
defaultMessage: 'Copied collection link to clipboard',
|
||||||
},
|
},
|
||||||
viewOtherCollections: {
|
|
||||||
id: 'collections.view_other_collections_by_user',
|
|
||||||
defaultMessage: 'View other collections by this user',
|
|
||||||
},
|
|
||||||
delete: {
|
delete: {
|
||||||
id: 'collections.delete_collection',
|
id: 'collections.delete_collection',
|
||||||
defaultMessage: 'Delete collection',
|
defaultMessage: 'Delete collection',
|
||||||
@ -168,25 +162,11 @@ export const CollectionMenu: React.FC<{
|
|||||||
return ownerItems;
|
return ownerItems;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const nonOwnerItems: MenuItem[] = [viewCollectionItem, ...shareItems];
|
const nonOwnerItems: MenuItem[] = [
|
||||||
|
viewCollectionItem,
|
||||||
if (context !== 'notifications' && ownerAccount) {
|
...shareItems,
|
||||||
const featuredCollectionsPath = `/@${ownerAccount.acct}/featured`;
|
null,
|
||||||
// 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);
|
|
||||||
|
|
||||||
// Collection notifications already have a prominent 'Remove me' button
|
// Collection notifications already have a prominent 'Remove me' button
|
||||||
if (currentAccountInCollection && context !== 'notifications') {
|
if (currentAccountInCollection && context !== 'notifications') {
|
||||||
@ -218,7 +198,6 @@ export const CollectionMenu: React.FC<{
|
|||||||
dispatch,
|
dispatch,
|
||||||
openDeleteConfirmation,
|
openDeleteConfirmation,
|
||||||
context,
|
context,
|
||||||
ownerAccount,
|
|
||||||
currentAccountInCollection,
|
currentAccountInCollection,
|
||||||
openReportModal,
|
openReportModal,
|
||||||
openBlockModal,
|
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_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.unlisted_collections_with_count": "Unlisted collections ({count})",
|
||||||
"collections.view_collection": "View collection",
|
"collections.view_collection": "View collection",
|
||||||
"collections.view_other_collections_by_user": "View other collections by this user",
|
|
||||||
"collections.visibility_public": "Public",
|
"collections.visibility_public": "Public",
|
||||||
"collections.visibility_public_hint": "Discoverable in search results and other areas where recommendations appear.",
|
"collections.visibility_public_hint": "Discoverable in search results and other areas where recommendations appear.",
|
||||||
"collections.visibility_title": "Visibility",
|
"collections.visibility_title": "Visibility",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user