mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Merge pull request #1630 from aidalgol/redact-dialog-fix
Rebase ConfirmRedactDialog on QuestionDialog
This commit is contained in:
commit
7826d0c61a
1 changed files with 8 additions and 43 deletions
|
@ -16,7 +16,6 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
import classnames from 'classnames';
|
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -24,51 +23,17 @@ import { _t } from '../../../languageHandler';
|
||||||
*/
|
*/
|
||||||
export default React.createClass({
|
export default React.createClass({
|
||||||
displayName: 'ConfirmRedactDialog',
|
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() {
|
render: function() {
|
||||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
const QuestionDialog = sdk.getComponent('views.dialogs.QuestionDialog');
|
||||||
|
|
||||||
const title = _t("Confirm Removal");
|
|
||||||
|
|
||||||
const confirmButtonClass = classnames({
|
|
||||||
'mx_Dialog_primary': true,
|
|
||||||
'danger': false,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseDialog className="mx_ConfirmUserActionDialog" onFinished={this.props.onFinished}
|
<QuestionDialog onFinished={this.props.onFinished}
|
||||||
onEnterPressed={this.onOk}
|
title={_t("Confirm Removal")}
|
||||||
title={title}
|
description={
|
||||||
>
|
_t("Are you sure you wish to remove (delete) this event? " +
|
||||||
<div className="mx_Dialog_content">
|
|
||||||
{ _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.")}
|
||||||
</div>
|
button={_t("Remove")}>
|
||||||
<div className="mx_Dialog_buttons">
|
</QuestionDialog>
|
||||||
<button className={confirmButtonClass} onClick={this.onOk}>
|
|
||||||
{ _t("Remove") }
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button onClick={this.onCancel}>
|
|
||||||
{ _t("Cancel") }
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</BaseDialog>
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue