Add a few more UIComponent flags, and ensure they are used in existing code (#7937)
* UIComponent flag: Explore rooms To disable the room directory access on the Home space. Can be controlled with the existing ComponentVisibilityCustomisation * Make "plus menu" respect component visibility * UIComponent flag: Add integrations To disable the widgets section of the room info card and addwidget slashcommand. Can be controlled with the existing ComponentVisibilityCustomisation * Make sure invite users component applies to space rooms too * Appease the linter
This commit is contained in:
parent
d304e24a45
commit
f882466329
7 changed files with 83 additions and 18 deletions
|
@ -44,6 +44,8 @@ import SpacePreferencesDialog, { SpacePreferenceTab } from "../components/views/
|
|||
import PosthogTrackers from "../PosthogTrackers";
|
||||
import { ButtonEvent } from "../components/views/elements/AccessibleButton";
|
||||
import { AfterLeaveRoomPayload } from "../dispatcher/payloads/AfterLeaveRoomPayload";
|
||||
import { shouldShowComponent } from "../customisations/helpers/UIComponents";
|
||||
import { UIComponent } from "../settings/UIFeature";
|
||||
|
||||
export const shouldShowSpaceSettings = (space: Room) => {
|
||||
const userId = space.client.getUserId();
|
||||
|
@ -110,8 +112,10 @@ export const showCreateNewRoom = async (space: Room): Promise<boolean> => {
|
|||
};
|
||||
|
||||
export const shouldShowSpaceInvite = (space: Room) =>
|
||||
(space?.getMyMembership() === "join" && space.canInvite(space.client.getUserId())) ||
|
||||
space.getJoinRule() === JoinRule.Public;
|
||||
(
|
||||
(space?.getMyMembership() === "join" && space.canInvite(space.client.getUserId())) ||
|
||||
space.getJoinRule() === JoinRule.Public
|
||||
) && shouldShowComponent(UIComponent.InviteUsers);
|
||||
|
||||
export const showSpaceInvite = (space: Room, initialText = ""): void => {
|
||||
if (space.getJoinRule() === "public") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue