Migrate ConfirmDestroyCrossSigningDialog to TypeScript
This commit is contained in:
parent
42538f8c75
commit
6b746b5d1d
1 changed files with 11 additions and 12 deletions
|
@ -15,22 +15,21 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import { _t } from "../../../../languageHandler";
|
||||||
import {_t} from "../../../../languageHandler";
|
|
||||||
import * as sdk from "../../../../index";
|
import * as sdk from "../../../../index";
|
||||||
import {replaceableComponent} from "../../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../../utils/replaceableComponent";
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
onFinished: (success: boolean) => void;
|
||||||
|
}
|
||||||
|
|
||||||
@replaceableComponent("views.dialogs.security.ConfirmDestroyCrossSigningDialog")
|
@replaceableComponent("views.dialogs.security.ConfirmDestroyCrossSigningDialog")
|
||||||
export default class ConfirmDestroyCrossSigningDialog extends React.Component {
|
export default class ConfirmDestroyCrossSigningDialog extends React.Component<IProps> {
|
||||||
static propTypes = {
|
private onConfirm = (): void => {
|
||||||
onFinished: PropTypes.func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
_onConfirm = () => {
|
|
||||||
this.props.onFinished(true);
|
this.props.onFinished(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
_onDecline = () => {
|
private onDecline = (): void => {
|
||||||
this.props.onFinished(false);
|
this.props.onFinished(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,10 +56,10 @@ export default class ConfirmDestroyCrossSigningDialog extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
<DialogButtons
|
<DialogButtons
|
||||||
primaryButton={_t("Clear cross-signing keys")}
|
primaryButton={_t("Clear cross-signing keys")}
|
||||||
onPrimaryButtonClick={this._onConfirm}
|
onPrimaryButtonClick={this.onConfirm}
|
||||||
primaryButtonClass="danger"
|
primaryButtonClass="danger"
|
||||||
cancelButton={_t("Cancel")}
|
cancelButton={_t("Cancel")}
|
||||||
onCancel={this._onDecline}
|
onCancel={this.onDecline}
|
||||||
/>
|
/>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
);
|
);
|
Loading…
Add table
Add a link
Reference in a new issue