Touch up settings: alignment, spacing, error states

Fixes https://github.com/vector-im/riot-web/issues/10554

Issues fixed:
* Fields were not ~30px from the avatar (too much right margin)
* Tooltips overflowed the dialog on some resolutions
* SetIdServer didn't have an error state for making the field red
* Spacing between sections in Discovery was wrong (fixed by just removing the problematic n+2 selector - it didn't help anything)
This commit is contained in:
Travis Ralston 2019-08-20 13:20:07 -06:00
parent 3c1adf62af
commit f55a40001c
8 changed files with 24 additions and 18 deletions

View file

@ -51,6 +51,9 @@ export default class Field extends React.PureComponent {
// If specified, contents will appear as a tooltip on the element and
// validation feedback tooltips will be suppressed.
tooltipContent: PropTypes.node,
// If specified alongside tooltipContent, the class name to apply to the
// tooltip itself.
tooltipClassName: PropTypes.string,
// All other props pass through to the <input>.
};
@ -177,8 +180,9 @@ export default class Field extends React.PureComponent {
const Tooltip = sdk.getComponent("elements.Tooltip");
let fieldTooltip;
if (tooltipContent || this.state.feedback) {
const addlClassName = this.props.tooltipClassName ? this.props.tooltipClassName : '';
fieldTooltip = <Tooltip
tooltipClassName="mx_Field_tooltip"
tooltipClassName={`mx_Field_tooltip ${addlClassName}`}
visible={this.state.feedbackVisible}
label={tooltipContent || this.state.feedback}
/>;