From 3b2c61e4566512b3f513aacd2ccfece2dbc37e31 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Thu, 21 Dec 2017 23:51:14 +1300 Subject: [PATCH] Use DialogButtons in QuestionDialog Use DialogButtons to eliminate duplicate button code. --- .../views/dialogs/QuestionDialog.js | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/components/views/dialogs/QuestionDialog.js b/src/components/views/dialogs/QuestionDialog.js index 339b284e2f..4197199bde 100644 --- a/src/components/views/dialogs/QuestionDialog.js +++ b/src/components/views/dialogs/QuestionDialog.js @@ -18,7 +18,6 @@ limitations under the License. import React from 'react'; import sdk from '../../../index'; import { _t } from '../../../languageHandler'; -import classnames from 'classnames'; export default React.createClass({ displayName: 'QuestionDialog', @@ -53,30 +52,27 @@ export default React.createClass({ render: function() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); - const cancelButton = this.props.hasCancelButton ? ( - - ) : null; - const buttonClasses = classnames({ - mx_Dialog_primary: true, - danger: this.props.danger, - }); + const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); + let primaryButtonClass = ""; + if (this.props.danger) { + primaryButtonClass = "danger"; + } return (
{ this.props.description } -
-
- +
. + { this.props.extraButtons } - { cancelButton } - +
); },