Add UI in settings to change ID Server
Just changes the current ID server being used To come in subsequent PRs: * Store this in account data * Check for terms or support the proper UI for accepting terms when setting * Support disconnecting Part 1 of https://github.com/vector-im/riot-web/issues/10094 Requires https://github.com/matrix-org/matrix-js-sdk/pull/1013
This commit is contained in:
parent
a9afdec24a
commit
c76514fceb
5 changed files with 30 additions and 14 deletions
|
@ -46,6 +46,9 @@ export default class Field extends React.PureComponent {
|
|||
// and a `feedback` react component field to provide feedback
|
||||
// to the user.
|
||||
onValidate: PropTypes.func,
|
||||
// If specified, contents will appear as a tooltip on the element and
|
||||
// validation feedback tooltips will be suppressed.
|
||||
tooltip: PropTypes.node,
|
||||
// All other props pass through to the <input>.
|
||||
};
|
||||
|
||||
|
@ -134,7 +137,7 @@ export default class Field extends React.PureComponent {
|
|||
}, VALIDATION_THROTTLE_MS);
|
||||
|
||||
render() {
|
||||
const { element, prefix, onValidate, children, ...inputProps } = this.props;
|
||||
const { element, prefix, onValidate, children, tooltip, ...inputProps } = this.props;
|
||||
|
||||
const inputElement = element || "input";
|
||||
|
||||
|
@ -165,12 +168,12 @@ export default class Field extends React.PureComponent {
|
|||
|
||||
// Handle displaying feedback on validity
|
||||
const Tooltip = sdk.getComponent("elements.Tooltip");
|
||||
let tooltip;
|
||||
if (this.state.feedback) {
|
||||
tooltip = <Tooltip
|
||||
let fieldTooltip;
|
||||
if (this.props.tooltip || this.state.feedback) {
|
||||
fieldTooltip = <Tooltip
|
||||
tooltipClassName="mx_Field_tooltip"
|
||||
visible={this.state.feedbackVisible}
|
||||
label={this.state.feedback}
|
||||
label={this.props.tooltip || this.state.feedback}
|
||||
/>;
|
||||
}
|
||||
|
||||
|
@ -178,7 +181,7 @@ export default class Field extends React.PureComponent {
|
|||
{prefixContainer}
|
||||
{fieldInput}
|
||||
<label htmlFor={this.props.id}>{this.props.label}</label>
|
||||
{tooltip}
|
||||
{fieldTooltip}
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,11 +26,11 @@ import LanguageDropdown from "../../../elements/LanguageDropdown";
|
|||
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||
import DeactivateAccountDialog from "../../../dialogs/DeactivateAccountDialog";
|
||||
import PropTypes from "prop-types";
|
||||
const PlatformPeg = require("../../../../../PlatformPeg");
|
||||
const MatrixClientPeg = require("../../../../../MatrixClientPeg");
|
||||
const sdk = require('../../../../..');
|
||||
const Modal = require("../../../../../Modal");
|
||||
const dis = require("../../../../../dispatcher");
|
||||
import PlatformPeg from "../../../../../PlatformPeg";
|
||||
import MatrixClientPeg from "../../../../../MatrixClientPeg";
|
||||
import sdk from "../../../../..";
|
||||
import Modal from "../../../../../Modal";
|
||||
import dis from "../../../../../dispatcher";
|
||||
|
||||
export default class GeneralUserSettingsTab extends React.Component {
|
||||
static propTypes = {
|
||||
|
@ -171,6 +171,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
_renderDiscoverySection() {
|
||||
const EmailAddresses = sdk.getComponent("views.settings.discovery.EmailAddresses");
|
||||
const PhoneNumbers = sdk.getComponent("views.settings.discovery.PhoneNumbers");
|
||||
const SetIdServer = sdk.getComponent("views.settings.SetIdServer");
|
||||
|
||||
return (
|
||||
<div className="mx_SettingsTab_section">
|
||||
|
@ -179,6 +180,8 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
|
||||
<span className="mx_SettingsTab_subheading">{_t("Phone numbers")}</span>
|
||||
<PhoneNumbers />
|
||||
{ /* has its own heading as it includes the current ID server */ }
|
||||
<SetIdServer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue