From d96043d5ab3e246cec1f6891352066ed2782a932 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 15 Feb 2021 17:34:28 +0000 Subject: [PATCH 1/2] Use config for host signup branding --- res/css/structures/_UserMenu.scss | 2 +- src/components/structures/HostSignupAction.tsx | 13 ++++++++++++- src/i18n/strings/en_EN.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/res/css/structures/_UserMenu.scss b/res/css/structures/_UserMenu.scss index f2577938e5..2a4453df70 100644 --- a/res/css/structures/_UserMenu.scss +++ b/res/css/structures/_UserMenu.scss @@ -128,7 +128,7 @@ limitations under the License. } .mx_UserMenu_contextMenu { - width: 247px; + width: 258px; // These override the styles already present on the user menu rather than try to // define a new menu. They are specifically for the stacked menu when a community diff --git a/src/components/structures/HostSignupAction.tsx b/src/components/structures/HostSignupAction.tsx index 39185acd05..9cf84a9379 100644 --- a/src/components/structures/HostSignupAction.tsx +++ b/src/components/structures/HostSignupAction.tsx @@ -21,6 +21,7 @@ import { } from "../views/context_menus/IconizedContextMenu"; import { _t } from "../../languageHandler"; import { HostSignupStore } from "../../stores/HostSignupStore"; +import SdkConfig from "../../SdkConfig"; interface IProps {} @@ -32,11 +33,21 @@ export default class HostSignupAction extends React.PureComponent diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a9d31bb9f2..d023984f7d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2450,7 +2450,7 @@ "Send a Direct Message": "Send a Direct Message", "Explore Public Rooms": "Explore Public Rooms", "Create a Group Chat": "Create a Group Chat", - "Upgrade to pro": "Upgrade to pro", + "Upgrade to %(hostSignupBrand)s": "Upgrade to %(hostSignupBrand)s", "Explore rooms": "Explore rooms", "Failed to reject invitation": "Failed to reject invitation", "Cannot create rooms in this community": "Cannot create rooms in this community", From 234f1bf2c47369c86d8c1a437c959dff828a1cb5 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 15 Feb 2021 17:38:11 +0000 Subject: [PATCH 2/2] Test domains in config directly --- src/components/structures/UserMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index 5b34d36d09..7f96e2d142 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -300,7 +300,7 @@ export default class UserMenu extends React.Component { const hostSignupDomains = hostSignupConfig.domains || []; const mxDomain = MatrixClientPeg.get().getDomain(); const validDomains = hostSignupDomains.filter(d => (d === mxDomain || mxDomain.endsWith(`.${d}`))); - if (!hostSignupDomains || validDomains.length > 0) { + if (!hostSignupConfig.domains || validDomains.length > 0) { topSection =
;