diff --git a/app/soapbox/components/groups/popover/group-popover.tsx b/app/soapbox/components/groups/popover/group-popover.tsx index ba2457fb3..245420af6 100644 --- a/app/soapbox/components/groups/popover/group-popover.tsx +++ b/app/soapbox/components/groups/popover/group-popover.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { Link } from 'react-router-dom'; +import { Link, matchPath, useHistory } from 'react-router-dom'; import { Button, Divider, HStack, Popover, Stack, Text } from 'soapbox/components/ui'; import GroupMemberCount from 'soapbox/features/group/components/group-member-count'; @@ -26,6 +26,13 @@ const GroupPopover = (props: IGroupPopoverContainer) => { const { children, group, isEnabled } = props; const intl = useIntl(); + const history = useHistory(); + + const path = history.location.pathname; + const shouldHideAction = matchPath(path, { + path: ['/group/:groupSlug'], + exact: true, + }); if (!isEnabled) { return children; @@ -36,7 +43,7 @@ const GroupPopover = (props: IGroupPopoverContainer) => { interaction='click' referenceElementClassName='cursor-pointer' content={ - + { -
- - - -
+ {!shouldHideAction && ( +
+ + + +
+ )}
} isFlush