Show "Invite" menu option if "UIComponent.sendInvites" is enabled. (#10363)
* Show "Invite" menu option if "UIComponent.sendInvites" is enabled. Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net> * Update test names Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net> --------- Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net> Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
This commit is contained in:
parent
d821323e5c
commit
68fa9aed9d
4 changed files with 121 additions and 3 deletions
|
@ -38,6 +38,8 @@ import IconizedContextMenu, {
|
|||
IconizedContextMenuOptionList,
|
||||
} from "../context_menus/IconizedContextMenu";
|
||||
import { ButtonEvent } from "../elements/AccessibleButton";
|
||||
import { shouldShowComponent } from "../../../customisations/helpers/UIComponents";
|
||||
import { UIComponent } from "../../../settings/UIFeature";
|
||||
|
||||
export interface RoomGeneralContextMenuProps extends IContextMenuProps {
|
||||
room: Room;
|
||||
|
@ -119,7 +121,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
|||
);
|
||||
|
||||
let inviteOption: JSX.Element | null = null;
|
||||
if (room.canInvite(cli.getUserId()!) && !isDm) {
|
||||
if (room.canInvite(cli.getUserId()!) && !isDm && shouldShowComponent(UIComponent.InviteUsers)) {
|
||||
inviteOption = (
|
||||
<IconizedContextMenuOption
|
||||
onClick={wrapHandler(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue