[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:
parent
8257bdcbca
commit
3916132f2f
@ -2,8 +2,6 @@ import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import { matchPath } from 'react-router';
|
||||
|
||||
import { showAlert } from '@/flavours/glitch/actions/alerts';
|
||||
import { initBlockModal } from '@/flavours/glitch/actions/blocks';
|
||||
import { useAccount } from '@/flavours/glitch/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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user