Hide add integrations button based on UIComponent.AddIntegrations (#30140)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-06-13 10:29:13 +01:00 committed by GitHub
parent 1e3fd9d3aa
commit a2bea649f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,8 @@ import AccessibleButton from "../elements/AccessibleButton";
import WidgetAvatar from "../avatars/WidgetAvatar";
import { IntegrationManagers } from "../../../integrations/IntegrationManagers";
import EmptyState from "./EmptyState";
import { shouldShowComponent } from "../../../customisations/helpers/UIComponents.ts";
import { UIComponent } from "../../../settings/UIFeature.ts";
interface Props {
room: Room;
@ -191,9 +193,11 @@ const ExtensionsCard: React.FC<Props> = ({ room, onClose }) => {
return (
<BaseCard header={_t("right_panel|extensions_button")} className="mx_ExtensionsCard" onClose={onClose}>
<Button size="sm" onClick={onManageIntegrations} kind="secondary" Icon={PlusIcon}>
{_t("right_panel|add_integrations")}
</Button>
{shouldShowComponent(UIComponent.AddIntegrations) && (
<Button size="sm" onClick={onManageIntegrations} kind="secondary" Icon={PlusIcon}>
{_t("right_panel|add_integrations")}
</Button>
)}
{body}
</BaseCard>
);