Merge pull request #3300 from matrix-org/dbkr/change_is
Add UI in settings to change ID Server
This commit is contained in:
commit
e2c5dc6bac
13 changed files with 273 additions and 20 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.
|
||||
tooltipContent: 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, tooltipContent, ...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 (tooltipContent || this.state.feedback) {
|
||||
fieldTooltip = <Tooltip
|
||||
tooltipClassName="mx_Field_tooltip"
|
||||
visible={this.state.feedbackVisible}
|
||||
label={this.state.feedback}
|
||||
label={tooltipContent || 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>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue