From aaf8106e9e71a902000b31f66988829f50843bb6 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 26 Nov 2017 15:46:24 +1300 Subject: [PATCH 1/2] Rebase ConfirmRedactDialog on QuestionDialog Rewrite the ConfirmRedactDialog component to derive from the QuestionDialog component. --- .../views/dialogs/ConfirmRedactDialog.js | 50 +++---------------- 1 file changed, 8 insertions(+), 42 deletions(-) diff --git a/src/components/views/dialogs/ConfirmRedactDialog.js b/src/components/views/dialogs/ConfirmRedactDialog.js index 7b5a9f776b..5c4ec30150 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.js +++ b/src/components/views/dialogs/ConfirmRedactDialog.js @@ -24,51 +24,17 @@ import { _t } from '../../../languageHandler'; */ export default React.createClass({ displayName: 'ConfirmRedactDialog', - propTypes: { - onFinished: React.PropTypes.func.isRequired, - }, - - defaultProps: { - danger: false, - }, - - onOk: function() { - this.props.onFinished(true); - }, - - onCancel: function() { - this.props.onFinished(false); - }, render: function() { - const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); - - const title = _t("Confirm Removal"); - - const confirmButtonClass = classnames({ - 'mx_Dialog_primary': true, - 'danger': false, - }); - + const QuestionDialog = sdk.getComponent('views.dialogs.QuestionDialog'); return ( - -
- { _t("Are you sure you wish to remove (delete) this event? " + - "Note that if you delete a room name or topic change, it could undo the change.") } -
-
- - - -
-
+ + ); }, }); From 3358fdc90640d4bcedceb5584ff52c735910a52c Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 26 Nov 2017 16:04:24 +1300 Subject: [PATCH 2/2] Address eslint errors * Remove space before curly brace. * Remove unused import. --- src/components/views/dialogs/ConfirmRedactDialog.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/views/dialogs/ConfirmRedactDialog.js b/src/components/views/dialogs/ConfirmRedactDialog.js index 5c4ec30150..a967b5df9a 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.js +++ b/src/components/views/dialogs/ConfirmRedactDialog.js @@ -16,7 +16,6 @@ limitations under the License. import React from 'react'; import sdk from '../../../index'; -import classnames from 'classnames'; import { _t } from '../../../languageHandler'; /* @@ -32,7 +31,7 @@ export default React.createClass({ title={_t("Confirm Removal")} description={ _t("Are you sure you wish to remove (delete) this event? " + - "Note that if you delete a room name or topic change, it could undo the change.") } + "Note that if you delete a room name or topic change, it could undo the change.")} button={_t("Remove")}> );