diff --git a/web/invite-links/invite-links-menu.css b/web/invite-links/invite-links-menu.css
index 6b33c182b..aa413da65 100644
--- a/web/invite-links/invite-links-menu.css
+++ b/web/invite-links/invite-links-menu.css
@@ -1,3 +1,4 @@
.container {
color: var(--menu-color-light);
+ width: 24px;
}
diff --git a/web/invite-links/invite-links-menu.react.js b/web/invite-links/invite-links-menu.react.js
index 7e24809b9..271c53cb5 100644
--- a/web/invite-links/invite-links-menu.react.js
+++ b/web/invite-links/invite-links-menu.react.js
@@ -1,52 +1,103 @@
// @flow
import * as React from 'react';
import { useModalContext } from 'lib/components/modal-provider.react.js';
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js';
+import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
+import { threadHasPermission } 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 css from './invite-links-menu.css';
import ViewInviteLinkModal from './view-invite-link-modal.react.js';
import MenuItem from '../components/menu-item.react.js';
import Menu from '../components/menu.react.js';
import { useSelector } from '../redux/redux-utils.js';
+import { AddLink } from '../vectors.react.js';
type Props = {
+communityID: string,
};
function InviteLinksMenu(props: Props): React.Node {
const { communityID } = props;
const inviteLink: ?InviteLink = useSelector(primaryInviteLinksSelector)[
communityID
];
const { pushModal } = useModalContext();
+ const community = useSelector(
+ state => threadInfoSelector(state)[communityID],
+ );
+ const canManageLinks = threadHasPermission(
+ community,
+ threadPermissions.MANAGE_INVITE_LINKS,
+ );
+
const openViewInviteLinkModal = React.useCallback(() => {
if (!inviteLink) {
return;
}
pushModal(