2019-07-04 01:46:37 +03:00
|
|
|
/*
|
|
|
|
Copyright 2019 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2021-06-29 15:11:58 +03:00
|
|
|
import { _t } from "../../../languageHandler";
|
|
|
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
2021-07-02 18:19:01 +03:00
|
|
|
import BaseDialog from "./BaseDialog";
|
|
|
|
import DialogButtons from "../elements/DialogButtons";
|
2019-07-04 01:46:37 +03:00
|
|
|
|
2021-06-14 23:38:10 +03:00
|
|
|
interface IProps {
|
|
|
|
onFinished: (success: boolean) => void;
|
|
|
|
}
|
2019-07-04 01:46:37 +03:00
|
|
|
|
2021-06-14 23:38:10 +03:00
|
|
|
@replaceableComponent("views.dialogs.ConfirmWipeDeviceDialog")
|
|
|
|
export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
|
|
|
|
private onConfirm = (): void => {
|
2019-07-04 01:46:37 +03:00
|
|
|
this.props.onFinished(true);
|
|
|
|
};
|
|
|
|
|
2021-06-14 23:38:10 +03:00
|
|
|
private onDecline = (): void => {
|
2019-07-04 01:46:37 +03:00
|
|
|
this.props.onFinished(false);
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2021-04-27 18:23:27 +03:00
|
|
|
<BaseDialog
|
|
|
|
className='mx_ConfirmWipeDeviceDialog'
|
|
|
|
hasCancel={true}
|
|
|
|
onFinished={this.props.onFinished}
|
|
|
|
title={_t("Clear all data in this session?")}
|
|
|
|
>
|
2019-07-04 01:46:37 +03:00
|
|
|
<div className='mx_ConfirmWipeDeviceDialog_content'>
|
|
|
|
<p>
|
|
|
|
{_t(
|
2020-01-29 18:48:25 +03:00
|
|
|
"Clearing all data from this session is permanent. Encrypted messages will be lost " +
|
2019-07-04 01:46:37 +03:00
|
|
|
"unless their keys have been backed up.",
|
|
|
|
)}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<DialogButtons
|
2019-07-05 00:22:25 +03:00
|
|
|
primaryButton={_t("Clear all data")}
|
2021-06-14 23:38:10 +03:00
|
|
|
onPrimaryButtonClick={this.onConfirm}
|
2019-07-05 00:22:25 +03:00
|
|
|
primaryButtonClass="danger"
|
2019-07-04 01:46:37 +03:00
|
|
|
cancelButton={_t("Cancel")}
|
2021-06-14 23:38:10 +03:00
|
|
|
onCancel={this.onDecline}
|
2019-07-04 01:46:37 +03:00
|
|
|
/>
|
|
|
|
</BaseDialog>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|