diff --git a/web/components/community-actions-menu.react.js b/web/components/community-actions-menu.react.js --- a/web/components/community-actions-menu.react.js +++ b/web/components/community-actions-menu.react.js @@ -9,6 +9,8 @@ import { useThreadHasPermission } from 'lib/shared/thread-utils.js'; import type { InviteLink } from 'lib/types/link-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; +import { threadTypes } from 'lib/types/thread-types-enum.js'; +import { useCurrentUserFID } from 'lib/utils/farcaster-utils.js'; import css from './community-actions-menu.css'; import MenuItem from '../components/menu-item.react.js'; @@ -18,6 +20,7 @@ import ViewInviteLinkModal from '../invite-links/view-invite-link-modal.react.js'; import { useSelector } from '../redux/redux-utils.js'; import CommunityRolesModal from '../roles/community-roles-modal.react.js'; +import TagFarcasterChannelModal from '../tag-farcaster-channel/tag-farcaster-channel-modal.react.js'; import { AddLink } from '../vectors.react.js'; type Props = { @@ -34,6 +37,9 @@ const community = useSelector( state => threadInfoSelector(state)[communityID], ); + + const fid = useCurrentUserFID(); + const canManageLinks = useThreadHasPermission( community, threadPermissions.MANAGE_INVITE_LINKS, @@ -42,6 +48,14 @@ community, threadPermissions.CHANGE_ROLE, ); + const canManageFarcasterChannelTag = useThreadHasPermission( + community, + threadPermissions.MANAGE_FARCASTER_CHANNEL_TAGS, + ); + const canTagFarcasterChannel = + canManageFarcasterChannelTag && + fid && + community.type !== threadTypes.GENESIS; const openViewInviteLinkModal = React.useCallback(() => { if (!inviteLink) { @@ -58,6 +72,10 @@ () => pushModal(), [community, pushModal], ); + const openFarcasterChannelTagModal = React.useCallback( + () => pushModal(), + [communityID, pushModal], + ); const items = React.useMemo(() => { const itemSpecs: MenuItemProps[] = []; @@ -86,14 +104,24 @@ }); } + if (canTagFarcasterChannel) { + itemSpecs.push({ + text: 'Tag Farcaster channel', + icon: 'tag', + onClick: openFarcasterChannelTagModal, + }); + } + return itemSpecs; }, [ canManageLinks, inviteLink, + canChangeRoles, + canTagFarcasterChannel, openManageInviteLinksModal, openViewInviteLinkModal, - canChangeRoles, openCommunityRolesModal, + openFarcasterChannelTagModal, ]); const menuItems = React.useMemo(