mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
DialogButtons: Allow setting the cancel button class with a prop.
This commit is contained in:
parent
cd225943ea
commit
5d3b916a89
1 changed files with 7 additions and 1 deletions
|
@ -40,6 +40,10 @@ export default createReactClass({
|
|||
// should there be a cancel button? default: true
|
||||
hasCancel: PropTypes.bool,
|
||||
|
||||
// The class of the cancel button, only used if a cancel button is
|
||||
// enabled
|
||||
cancelButtonClass: PropTypes.node,
|
||||
|
||||
// onClick handler for the cancel button.
|
||||
onCancel: PropTypes.func,
|
||||
|
||||
|
@ -69,8 +73,10 @@ export default createReactClass({
|
|||
primaryButtonClassName += " " + this.props.primaryButtonClass;
|
||||
}
|
||||
let cancelButton;
|
||||
|
||||
if (this.props.cancelButton || this.props.hasCancel) {
|
||||
cancelButton = <button onClick={this._onCancelClick} disabled={this.props.disabled}>
|
||||
cancelButton = <button className={this.props.cancelButtonClass}
|
||||
onClick={this._onCancelClick} disabled={this.props.disabled}>
|
||||
{ this.props.cancelButton || _t("Cancel") }
|
||||
</button>;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue