diff --git a/res/css/_components.scss b/res/css/_components.scss index f175981e9f..69f0e9b05a 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -69,9 +69,9 @@ @import "./views/dialogs/_DeactivateAccountDialog.scss"; @import "./views/dialogs/_DevtoolsDialog.scss"; @import "./views/dialogs/_EditCommunityPrototypeDialog.scss"; -@import "./views/dialogs/_ElementProDialog.scss"; @import "./views/dialogs/_FeedbackDialog.scss"; @import "./views/dialogs/_GroupAddressPicker.scss"; +@import "./views/dialogs/_HostSignupDialog.scss"; @import "./views/dialogs/_IncomingSasDialog.scss"; @import "./views/dialogs/_InviteDialog.scss"; @import "./views/dialogs/_KeyboardShortcutsDialog.scss"; diff --git a/res/css/views/dialogs/_ElementProDialog.scss b/res/css/views/dialogs/_HostSignupDialog.scss similarity index 89% rename from res/css/views/dialogs/_ElementProDialog.scss rename to res/css/views/dialogs/_HostSignupDialog.scss index 137454a8e5..9c7b40209f 100644 --- a/res/css/views/dialogs/_ElementProDialog.scss +++ b/res/css/views/dialogs/_HostSignupDialog.scss @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ElementProDialog .mx_Dialog { +.mx_HostSignupDialog .mx_Dialog { height: 66%; min-width: 50%; } -.mx_ElementProBaseDialog { +.mx_HostSignupBaseDialog { height: 100%; } -.mx_ElementProDialog_container { +.mx_HostSignupDialog_container { height: 90%; iframe { diff --git a/src/components/structures/ElementProAction.tsx b/src/components/structures/HostSignupAction.tsx similarity index 87% rename from src/components/structures/ElementProAction.tsx rename to src/components/structures/HostSignupAction.tsx index fdd7df8410..eba8bb5875 100644 --- a/src/components/structures/ElementProAction.tsx +++ b/src/components/structures/HostSignupAction.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import * as React from "react"; -import ElementProDialog from "../views/dialogs/ElementProDialog"; +import HostSignupDialog from "../views/dialogs/HostSignupDialog"; import Modal, {IHandle} from "../../Modal"; import { IconizedContextMenuOption, @@ -27,15 +27,15 @@ interface IProps {} interface IState {} -export default class ElementProAction extends React.PureComponent { +export default class HostSignupAction extends React.PureComponent { private closingAllowed = false; private modalRef: IHandle; private openDialog = () => { this.modalRef = Modal.createTrackedDialog( - 'Element Pro Open', '', ElementProDialog, { + 'Host Signup Open', '', HostSignupDialog, { requestClose: this.requestClose, - }, "mx_ElementProDialog", false, true, { + }, "mx_HostSignupDialog", false, true, { onBeforeClose: async () => this.closingAllowed, }, ); diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index f8dd4e0b91..28818dd76e 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -51,7 +51,7 @@ import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import ErrorDialog from "../views/dialogs/ErrorDialog"; import EditCommunityPrototypeDialog from "../views/dialogs/EditCommunityPrototypeDialog"; import {UIFeature} from "../../settings/UIFeature"; -import ElementProAction from "./ElementProAction"; +import HostSignupAction from "./HostSignupAction"; interface IProps { isMinimized: boolean; @@ -274,7 +274,7 @@ export default class UserMenu extends React.Component { let topSection; const signupLink = getHostingLink("user-context-menu"); - const elementProConfig = SdkConfig.get().element_pro; + const hostSignupConfig = SdkConfig.get().host_signup; if (MatrixClientPeg.get().isGuest()) { topSection = (
@@ -294,20 +294,20 @@ export default class UserMenu extends React.Component { })}
) - } else if (signupLink || elementProConfig) { - let elementProIFrame; - if (elementProConfig && elementProConfig.url) { - // If element_pro.domains is set to a non-empty array, only show + } else if (signupLink || hostSignupConfig) { + let hostSignupAction; + if (hostSignupConfig && hostSignupConfig.url) { + // If host_signup.domains is set to a non-empty array, only show // dialog if the user is on the domain or a subdomain. - const elementProDomains = elementProConfig.domains || []; + const hostSignupDomains = hostSignupConfig.domains || []; const mxDomain = MatrixClientPeg.get().getDomain(); - const validDomains = elementProDomains.filter(d => (d === mxDomain || mxDomain.endsWith(`.${d}`))); - if (!elementProDomains || validDomains.length > 0) { - elementProIFrame =
(d === mxDomain || mxDomain.endsWith(`.${d}`))); + if (!hostSignupDomains || validDomains.length > 0) { + hostSignupAction =
- +
; } } @@ -327,7 +327,7 @@ export default class UserMenu extends React.Component { )}
} - {elementProIFrame} + {hostSignupAction} ); } diff --git a/src/components/views/dialogs/ElementProDialog.tsx b/src/components/views/dialogs/HostSignupDialog.tsx similarity index 88% rename from src/components/views/dialogs/ElementProDialog.tsx rename to src/components/views/dialogs/HostSignupDialog.tsx index bdcfb6e783..07d32facbf 100644 --- a/src/components/views/dialogs/ElementProDialog.tsx +++ b/src/components/views/dialogs/HostSignupDialog.tsx @@ -23,7 +23,7 @@ import SdkConfig from "../../../SdkConfig"; import {_t} from "../../../languageHandler"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {OwnProfileStore} from "../../../stores/OwnProfileStore"; -import {IPostmessage, IPostmessageResponseData, PostmessageAction} from "./ElementProDialogTypes"; +import {IPostmessage, IPostmessageResponseData, PostmessageAction} from "./HostSignupDialogTypes"; interface IProps { requestClose(): void; @@ -34,9 +34,9 @@ interface IState { error: string; } -export default class ElementProDialog extends React.PureComponent { +export default class HostSignupDialog extends React.PureComponent { private iframeRef: React.RefObject = React.createRef(); - private readonly elementProSetupUrl: string; + private readonly hostSignupSetupUrl: string; constructor(props: IProps) { super(props); @@ -46,15 +46,15 @@ export default class ElementProDialog extends React.PureComponent { - if (!this.elementProSetupUrl.startsWith(message.origin)) { + if (!this.hostSignupSetupUrl.startsWith(message.origin)) { return; } switch (message.data.action) { - case PostmessageAction.ElementProAccountDetailsRequest: + case PostmessageAction.HostSignupAccountDetailsRequest: Modal.createDialog( ElementProDataConfirmDialog, { @@ -98,7 +98,7 @@ export default class ElementProDialog extends React.PureComponent { - this.iframeRef.current.contentWindow.postMessage(message, this.elementProSetupUrl); + this.iframeRef.current.contentWindow.postMessage(message, this.hostSignupSetupUrl); } private async sendAccountDetails() { @@ -111,7 +111,7 @@ export default class ElementProDialog extends React.PureComponent -
+