[Glitch] Remove "View other collections from this user" from collection menu

Port e571994b5c6700cd896795f792978a709a09c5ce to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion 2026-04-17 10:50:35 +02:00 committed by Claire
parent 8257bdcbca
commit 3916132f2f

View File

@ -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 '@/flavours/glitch/actions/alerts'; import { showAlert } from '@/flavours/glitch/actions/alerts';
import { initBlockModal } from '@/flavours/glitch/actions/blocks'; import { initBlockModal } from '@/flavours/glitch/actions/blocks';
import { useAccount } from '@/flavours/glitch/hooks/useAccount'; import { useAccount } from '@/flavours/glitch/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,