* Copyright headers 1 * Licence headers 2 * Copyright Headers 3 * Copyright Headers 4 * Copyright Headers 5 * Copyright Headers 6 * Copyright headers 7 * Add copyright headers for html and config file * Replace license files and update package.json * Update with CLA * lint
61 lines
2.2 KiB
TypeScript
61 lines
2.2 KiB
TypeScript
/*
|
|
Copyright 2024 New Vector Ltd.
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
Copyright 2019 New Vector Ltd
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React from "react";
|
|
|
|
import dis from "../../../../dispatcher/dispatcher";
|
|
import { _t } from "../../../../languageHandler";
|
|
import Modal, { ComponentType } from "../../../../Modal";
|
|
import { Action } from "../../../../dispatcher/actions";
|
|
import BaseDialog from "../../../../components/views/dialogs/BaseDialog";
|
|
import DialogButtons from "../../../../components/views/elements/DialogButtons";
|
|
|
|
interface IProps {
|
|
onFinished(): void;
|
|
}
|
|
|
|
export default class RecoveryMethodRemovedDialog extends React.PureComponent<IProps> {
|
|
private onGoToSettingsClick = (): void => {
|
|
this.props.onFinished();
|
|
dis.fire(Action.ViewUserSettings);
|
|
};
|
|
|
|
private onSetupClick = (): void => {
|
|
this.props.onFinished();
|
|
Modal.createDialogAsync(
|
|
import("./CreateKeyBackupDialog") as unknown as Promise<ComponentType>,
|
|
undefined,
|
|
undefined,
|
|
/* priority = */ false,
|
|
/* static = */ true,
|
|
);
|
|
};
|
|
|
|
public render(): React.ReactNode {
|
|
const title = (
|
|
<span className="mx_KeyBackupFailedDialog_title">{_t("encryption|recovery_method_removed|title")}</span>
|
|
);
|
|
|
|
return (
|
|
<BaseDialog className="mx_KeyBackupFailedDialog" onFinished={this.props.onFinished} title={title}>
|
|
<div>
|
|
<p>{_t("encryption|recovery_method_removed|description_1")}</p>
|
|
<p>{_t("encryption|recovery_method_removed|description_2")}</p>
|
|
<strong className="warning">{_t("encryption|recovery_method_removed|warning")}</strong>
|
|
<DialogButtons
|
|
primaryButton={_t("common|setup_secure_messages")}
|
|
onPrimaryButtonClick={this.onSetupClick}
|
|
cancelButton={_t("common|go_to_settings")}
|
|
onCancel={this.onGoToSettingsClick}
|
|
/>
|
|
</div>
|
|
</BaseDialog>
|
|
);
|
|
}
|
|
}
|