From 65e67003f332dbffe6d936d6ca0d5cc8f723b674 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Sat, 2 Oct 2021 00:52:17 -0400 Subject: [PATCH] Allow hiding "Sign Up" in the guest preview bar Hide the button when "UIFeature.registration" is set to false in Element's config.json. Fixes https://github.com/vector-im/element-web/issues/19264 Signed-off-by: Andrew Ferrazzutti --- src/components/views/rooms/RoomPreviewBar.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 2acefc93d6..82437a5c14 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -35,6 +35,8 @@ import InviteReason from "../elements/InviteReason"; import { IOOBData } from "../../../stores/ThreepidInviteStore"; import Spinner from "../elements/Spinner"; import AccessibleButton from "../elements/AccessibleButton"; +import { UIFeature } from "../../../settings/UIFeature"; +import SettingsStore from "../../../settings/SettingsStore"; const MemberEventHtmlReasonField = "io.element.html_reason"; @@ -339,8 +341,10 @@ export default class RoomPreviewBar extends React.Component { } case MessageCase.NotLoggedIn: { title = _t("Join the conversation with an account"); - primaryActionLabel = _t("Sign Up"); - primaryActionHandler = this.onRegisterClick; + if (SettingsStore.getValue(UIFeature.Registration)) { + primaryActionLabel = _t("Sign Up"); + primaryActionHandler = this.onRegisterClick; + } secondaryActionLabel = _t("Sign In"); secondaryActionHandler = this.onLoginClick; if (this.props.previewLoading) {