Migrate ConfirmWipeDeviceDialog to TypeScript

This commit is contained in:
Germain Souquet 2021-06-14 21:38:10 +01:00
parent c2aaba1f79
commit 5cbbb5110b

View file

@ -20,17 +20,17 @@ import {_t} from "../../../languageHandler";
import * as sdk from "../../../index"; import * as sdk from "../../../index";
import {replaceableComponent} from "../../../utils/replaceableComponent"; import {replaceableComponent} from "../../../utils/replaceableComponent";
@replaceableComponent("views.dialogs.ConfirmWipeDeviceDialog") interface IProps {
export default class ConfirmWipeDeviceDialog extends React.Component { onFinished: (success: boolean) => void;
static propTypes = { }
onFinished: PropTypes.func.isRequired,
};
_onConfirm = () => { @replaceableComponent("views.dialogs.ConfirmWipeDeviceDialog")
export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
private onConfirm = (): void => {
this.props.onFinished(true); this.props.onFinished(true);
}; };
_onDecline = () => { private onDecline = (): void => {
this.props.onFinished(false); this.props.onFinished(false);
}; };
@ -55,10 +55,10 @@ export default class ConfirmWipeDeviceDialog extends React.Component {
</div> </div>
<DialogButtons <DialogButtons
primaryButton={_t("Clear all data")} primaryButton={_t("Clear all data")}
onPrimaryButtonClick={this._onConfirm} onPrimaryButtonClick={this.onConfirm}
primaryButtonClass="danger" primaryButtonClass="danger"
cancelButton={_t("Cancel")} cancelButton={_t("Cancel")}
onCancel={this._onDecline} onCancel={this.onDecline}
/> />
</BaseDialog> </BaseDialog>
); );