Fix styling of NetworkDropdown dialogs

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-03-16 12:00:56 +00:00
parent 6f27c4c17a
commit 82a37ba0ad
4 changed files with 18 additions and 4 deletions

View file

@ -157,3 +157,7 @@ limitations under the License.
font-size: 12px; font-size: 12px;
} }
} }
.mx_NetworkDropdown_dialog .mx_Dialog {
width: 557px;
}

View file

@ -33,6 +33,7 @@ export default createReactClass({
onFinished: PropTypes.func.isRequired, onFinished: PropTypes.func.isRequired,
headerImage: PropTypes.string, headerImage: PropTypes.string,
quitOnly: PropTypes.bool, // quitOnly doesn't show the cancel button just the quit [x]. quitOnly: PropTypes.bool, // quitOnly doesn't show the cancel button just the quit [x].
fixedWidth: PropTypes.bool,
}, },
getDefaultProps: function() { getDefaultProps: function() {
@ -63,11 +64,14 @@ export default createReactClass({
primaryButtonClass = "danger"; primaryButtonClass = "danger";
} }
return ( return (
<BaseDialog className="mx_QuestionDialog" onFinished={this.props.onFinished} <BaseDialog
className="mx_QuestionDialog"
onFinished={this.props.onFinished}
title={this.props.title} title={this.props.title}
contentId='mx_Dialog_content' contentId='mx_Dialog_content'
headerImage={this.props.headerImage} headerImage={this.props.headerImage}
hasCancel={this.props.hasCancelButton} hasCancel={this.props.hasCancelButton}
fixedWidth={this.props.fixedWidth}
> >
<div className="mx_Dialog_content" id='mx_Dialog_content'> <div className="mx_Dialog_content" id='mx_Dialog_content'>
{ this.props.description } { this.props.description }

View file

@ -35,6 +35,7 @@ export default createReactClass({
onFinished: PropTypes.func.isRequired, onFinished: PropTypes.func.isRequired,
hasCancel: PropTypes.bool, hasCancel: PropTypes.bool,
validator: PropTypes.func, // result of withValidation validator: PropTypes.func, // result of withValidation
fixedWidth: PropTypes.bool,
}, },
getDefaultProps: function() { getDefaultProps: function() {
@ -102,8 +103,11 @@ export default createReactClass({
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
return ( return (
<BaseDialog className="mx_TextInputDialog" onFinished={this.props.onFinished} <BaseDialog
className="mx_TextInputDialog"
onFinished={this.props.onFinished}
title={this.props.title} title={this.props.title}
fixedWidth={this.props.fixedWidth}
> >
<form onSubmit={this.onOk}> <form onSubmit={this.onOk}>
<div className="mx_Dialog_content"> <div className="mx_Dialog_content">

View file

@ -169,7 +169,8 @@ const NetworkDropdown = ({onOptionChange, protocols = {}, selectedServerName, se
b: serverName => <b>{ serverName }</b>, b: serverName => <b>{ serverName }</b>,
}), }),
button: _t("Remove"), button: _t("Remove"),
}); fixedWidth: false,
}, "mx_NetworkDropdown_dialog");
const [ok] = await finished; const [ok] = await finished;
if (!ok) return; if (!ok) return;
@ -218,7 +219,8 @@ const NetworkDropdown = ({onOptionChange, protocols = {}, selectedServerName, se
hasCancel: false, hasCancel: false,
placeholder: _t("Server name"), placeholder: _t("Server name"),
validator: validServer, validator: validServer,
}); fixedWidth: false,
}, "mx_NetworkDropdown_dialog");
const [ok, newServer] = await finished; const [ok, newServer] = await finished;
if (!ok) return; if (!ok) return;