Use DialogButtons in TextInputDialog
Use DialogButtons to eliminate duplicate button code.pull/21833/head
parent
a11146f39d
commit
2674fcb6d3
|
@ -58,6 +58,7 @@ export default React.createClass({
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
|
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}
|
||||||
onEnterPressed={this.onOk}
|
onEnterPressed={this.onOk}
|
||||||
|
@ -71,14 +72,9 @@ export default React.createClass({
|
||||||
<input id="textinput" ref="textinput" className="mx_TextInputDialog_input" defaultValue={this.props.value} autoFocus={this.props.focus} size="64" />
|
<input id="textinput" ref="textinput" className="mx_TextInputDialog_input" defaultValue={this.props.value} autoFocus={this.props.focus} size="64" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_Dialog_buttons">
|
<DialogButtons primaryButton={this.props.button}
|
||||||
<button onClick={this.onCancel}>
|
onPrimaryButtonClick={this.onOk}
|
||||||
{ _t("Cancel") }
|
onCancel={this.onCancel} />
|
||||||
</button>
|
|
||||||
<button className="mx_Dialog_primary" onClick={this.onOk}>
|
|
||||||
{ this.props.button }
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue