Files
ThreadNet-Web/apps/web/src/components/views/dialogs/StorageEvictedDialog.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
2.3 KiB
TypeScript
Raw Normal View History

2019-03-28 16:22:17 +00:00
/*
2024-09-09 14:57:16 +01:00
Copyright 2019-2024 New Vector Ltd.
2019-03-28 16:22:17 +00:00
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
2024-09-09 14:57:16 +01:00
Please see LICENSE files in the repository root for full details.
2019-03-28 16:22:17 +00:00
*/
import React from "react";
2021-10-22 17:23:32 -05:00
2019-03-28 16:22:17 +00:00
import SdkConfig from "../../../SdkConfig";
import Modal from "../../../Modal";
import { _t } from "../../../languageHandler";
2021-09-05 10:53:57 +02:00
import BaseDialog from "./BaseDialog";
import DialogButtons from "../elements/DialogButtons";
import BugReportDialog from "./BugReportDialog";
2025-02-05 13:25:06 +00:00
import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton";
2021-09-05 10:53:57 +02:00
interface IProps {
onFinished(signOut?: boolean): void;
}
2019-03-28 16:22:17 +00:00
2021-09-05 10:53:57 +02:00
export default class StorageEvictedDialog extends React.Component<IProps> {
private sendBugReport = (ev: ButtonEvent): void => {
2019-03-28 16:22:17 +00:00
ev.preventDefault();
2022-06-14 17:51:51 +01:00
Modal.createDialog(BugReportDialog, {});
2019-03-28 16:22:17 +00:00
};
2021-09-05 10:53:57 +02:00
private onSignOutClick = (): void => {
2019-03-28 16:22:17 +00:00
this.props.onFinished(true);
};
public render(): React.ReactNode {
2019-03-28 16:22:17 +00:00
let logRequest;
if (SdkConfig.get().bug_report_endpoint_url) {
logRequest = _t(
"bug_reporting|log_request",
2021-04-29 19:57:02 +02:00
{},
2021-04-27 17:23:27 +02:00
{
2022-01-07 10:40:53 +01:00
a: (text) => (
<AccessibleButton kind="link_inline" onClick={this.sendBugReport}>
{text}
</AccessibleButton>
),
2021-04-27 17:23:27 +02:00
},
);
2019-03-28 16:22:17 +00:00
}
return (
2021-07-23 10:23:45 +01:00
<BaseDialog
className="mx_ErrorDialog"
onFinished={this.props.onFinished}
title={_t("error|storage_evicted_title")}
2019-03-28 16:22:17 +00:00
contentId="mx_Dialog_content"
hasCancel={false}
>
<div className="mx_Dialog_content" id="mx_Dialog_content">
<p>{_t("error|storage_evicted_description_1")}</p>
<p>
{_t("error|storage_evicted_description_2")} {logRequest}
</p>
2019-03-28 16:22:17 +00:00
</div>
<DialogButtons
primaryButton={_t("action|sign_out")}
2021-09-05 10:53:57 +02:00
onPrimaryButtonClick={this.onSignOutClick}
2019-03-28 16:22:17 +00:00
focus={true}
hasCancel={false}
/>
</BaseDialog>
);
}
}