diff --git a/src/components/views/auth/CustomServerDialog.js b/src/components/views/auth/CustomServerDialog.js deleted file mode 100644 index 138f8c4689f..00000000000 --- a/src/components/views/auth/CustomServerDialog.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2015, 2016 OpenMarket Ltd -Copyright 2019, 2020 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import React from 'react'; -import { _t } from '../../../languageHandler'; -import SdkConfig from '../../../SdkConfig'; - -export default class CustomServerDialog extends React.Component { - render() { - const brand = SdkConfig.get().brand; - return ( -
-
- { _t("Custom Server Options") } -
-
-

{_t( - "You can use the custom server options to sign into other " + - "Matrix servers by specifying a different homeserver URL. This " + - "allows you to use %(brand)s with an existing Matrix account on a " + - "different homeserver.", - { brand }, - )}

-
-
- -
-
- ); - } -} diff --git a/src/components/views/auth/ServerConfig.js b/src/components/views/auth/ServerConfig.js index ee6f57a521b..313ca53bf8f 100644 --- a/src/components/views/auth/ServerConfig.js +++ b/src/components/views/auth/ServerConfig.js @@ -26,6 +26,7 @@ import AutoDiscoveryUtils from "../../../utils/AutoDiscoveryUtils"; import SdkConfig from "../../../SdkConfig"; import { createClient } from 'matrix-js-sdk/src/matrix'; import classNames from 'classnames'; +import InfoDialog from "../dialogs/InfoDialog"; /* * A pure UI component which displays the HS and IS to use. @@ -211,16 +212,37 @@ export default class ServerConfig extends React.PureComponent { return setTimeout(fn.bind(this), this.props.delayTimeMs); } - showHelpPopup = () => { - const CustomServerDialog = sdk.getComponent('auth.CustomServerDialog'); - Modal.createTrackedDialog('Custom Server Dialog', '', CustomServerDialog); + showHsHelpPopup = () => { + Modal.createTrackedDialog('What does this mean?', 'HS', InfoDialog, { + title: _t("Homeserver URL"), + description: _t( + "You can use the custom server options to sign into other " + + "Matrix servers by specifying a different homeserver URL. This " + + "allows you to use %(brand)s with an existing Matrix account on a " + + "different homeserver.", + { brand: SdkConfig.get().brand }, + ), + button: _t("Dismiss"), + }); + }; + + showIdentityServerHelpPopup = () => { + Modal.createTrackedDialog('What does this mean?', 'IS', InfoDialog, { + title: _t("Identity Server URL"), + description: _t( + "The optional identity server is responsible for allowing you " + + "to find people by their e-mail address and phone number.", + { brand: SdkConfig.get().brand }, + ), + button: _t("Dismiss"), + }); }; _renderHomeserverSection() { const Field = sdk.getComponent('elements.Field'); return
{_t("Enter your custom homeserver URL What does this mean?", {}, { - a: sub => + a: sub => {sub} , })} @@ -244,7 +266,7 @@ export default class ServerConfig extends React.PureComponent { }); return
{_t("Enter your custom identity server URL What does this mean?", {}, { - a: sub => + a: sub => {sub} , })} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index eb8f9100eca..5b9f494c990 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1923,8 +1923,6 @@ "powered by Matrix": "powered by Matrix", "This homeserver would like to make sure you are not a robot.": "This homeserver would like to make sure you are not a robot.", "Country Dropdown": "Country Dropdown", - "Custom Server Options": "Custom Server Options", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use %(brand)s with an existing Matrix account on a different homeserver.": "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use %(brand)s with an existing Matrix account on a different homeserver.", "Confirm your identity by entering your account password below.": "Confirm your identity by entering your account password below.", "Password": "Password", "Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator.": "Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator.", @@ -1973,10 +1971,12 @@ "Register": "Register", "Set an email for account recovery. Use email or phone to optionally be discoverable by existing contacts.": "Set an email for account recovery. Use email or phone to optionally be discoverable by existing contacts.", "Set an email for account recovery. Use email to optionally be discoverable by existing contacts.": "Set an email for account recovery. Use email to optionally be discoverable by existing contacts.", - "Enter your custom homeserver URL What does this mean?": "Enter your custom homeserver URL What does this mean?", "Homeserver URL": "Homeserver URL", - "Enter your custom identity server URL What does this mean?": "Enter your custom identity server URL What does this mean?", + "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use %(brand)s with an existing Matrix account on a different homeserver.": "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use %(brand)s with an existing Matrix account on a different homeserver.", "Identity Server URL": "Identity Server URL", + "The optional identity server is responsible for allowing you to find people by their e-mail address and phone number.": "The optional identity server is responsible for allowing you to find people by their e-mail address and phone number.", + "Enter your custom homeserver URL What does this mean?": "Enter your custom homeserver URL What does this mean?", + "Enter your custom identity server URL What does this mean?": "Enter your custom identity server URL What does this mean?", "Other servers": "Other servers", "Free": "Free", "Join millions for free on the largest public server": "Join millions for free on the largest public server",