2019-07-03 16:46:37 -06:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2019-07-03 16:46:37 -06:00
|
|
|
Copyright 2019 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2024-09-09 14:57:16 +01:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2019-07-03 16:46:37 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
2021-10-22 17:23:32 -05:00
|
|
|
|
2021-06-29 13:11:58 +01:00
|
|
|
import { _t } from "../../../languageHandler";
|
2021-07-02 17:19:01 +02:00
|
|
|
import BaseDialog from "./BaseDialog";
|
|
|
|
|
import DialogButtons from "../elements/DialogButtons";
|
2019-07-03 16:46:37 -06:00
|
|
|
|
2021-06-14 21:38:10 +01:00
|
|
|
interface IProps {
|
2023-02-28 10:31:48 +00:00
|
|
|
onFinished: (success?: boolean) => void;
|
2021-06-14 21:38:10 +01:00
|
|
|
}
|
2019-07-03 16:46:37 -06:00
|
|
|
|
2021-06-14 21:38:10 +01:00
|
|
|
export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
|
|
|
|
|
private onConfirm = (): void => {
|
2019-07-03 16:46:37 -06:00
|
|
|
this.props.onFinished(true);
|
|
|
|
|
};
|
|
|
|
|
|
2021-06-14 21:38:10 +01:00
|
|
|
private onDecline = (): void => {
|
2019-07-03 16:46:37 -06:00
|
|
|
this.props.onFinished(false);
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-13 17:01:43 +00:00
|
|
|
public render(): React.ReactNode {
|
2019-07-03 16:46:37 -06:00
|
|
|
return (
|
2021-04-27 17:23:27 +02:00
|
|
|
<BaseDialog
|
|
|
|
|
className="mx_ConfirmWipeDeviceDialog"
|
|
|
|
|
hasCancel={true}
|
|
|
|
|
onFinished={this.props.onFinished}
|
2023-10-03 19:17:26 +01:00
|
|
|
title={_t("auth|soft_logout|clear_data_title")}
|
2021-04-27 17:23:27 +02:00
|
|
|
>
|
2019-07-03 16:46:37 -06:00
|
|
|
<div className="mx_ConfirmWipeDeviceDialog_content">
|
2023-10-03 19:17:26 +01:00
|
|
|
<p>{_t("auth|soft_logout|clear_data_description")}</p>
|
2019-07-03 16:46:37 -06:00
|
|
|
</div>
|
|
|
|
|
<DialogButtons
|
2023-10-03 19:17:26 +01:00
|
|
|
primaryButton={_t("auth|soft_logout|clear_data_button")}
|
2021-06-14 21:38:10 +01:00
|
|
|
onPrimaryButtonClick={this.onConfirm}
|
2019-07-04 15:22:25 -06:00
|
|
|
primaryButtonClass="danger"
|
2023-08-23 11:57:22 +01:00
|
|
|
cancelButton={_t("action|cancel")}
|
2021-06-14 21:38:10 +01:00
|
|
|
onCancel={this.onDecline}
|
2019-07-03 16:46:37 -06:00
|
|
|
/>
|
|
|
|
|
</BaseDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|