2019-11-20 20:40:39 -07: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-10-22 17:23:32 -05:00
|
|
|
|
2021-06-29 13:11:58 +01:00
|
|
|
import { _t } from "../../../languageHandler";
|
2020-05-13 20:41:41 -06:00
|
|
|
import dis from '../../../dispatcher/dispatcher';
|
2021-06-29 13:11:58 +01:00
|
|
|
import { Action } from "../../../dispatcher/actions";
|
2021-09-05 16:09:33 +02:00
|
|
|
import BaseDialog from "./BaseDialog";
|
|
|
|
|
import DialogButtons from "../elements/DialogButtons";
|
2021-09-10 19:01:05 +02:00
|
|
|
import { IDialogProps } from "./IDialogProps";
|
2021-09-05 16:09:33 +02:00
|
|
|
|
2021-09-10 19:01:05 +02:00
|
|
|
interface IProps extends IDialogProps {}
|
2019-11-20 20:40:39 -07:00
|
|
|
|
2021-09-05 16:09:33 +02:00
|
|
|
export default class IntegrationsDisabledDialog extends React.Component<IProps> {
|
|
|
|
|
private onAcknowledgeClick = (): void => {
|
2019-11-20 20:40:39 -07:00
|
|
|
this.props.onFinished();
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-05 16:09:33 +02:00
|
|
|
private onOpenSettingsClick = (): void => {
|
2019-11-20 20:40:39 -07:00
|
|
|
this.props.onFinished();
|
2020-05-13 21:07:19 -06:00
|
|
|
dis.fire(Action.ViewUserSettings);
|
2019-11-20 20:40:39 -07:00
|
|
|
};
|
|
|
|
|
|
2021-09-05 16:09:33 +02:00
|
|
|
public render(): JSX.Element {
|
2019-11-20 20:40:39 -07:00
|
|
|
return (
|
2021-04-27 17:23:27 +02:00
|
|
|
<BaseDialog
|
|
|
|
|
className='mx_IntegrationsDisabledDialog'
|
|
|
|
|
hasCancel={true}
|
|
|
|
|
onFinished={this.props.onFinished}
|
|
|
|
|
title={_t("Integrations are disabled")}
|
|
|
|
|
>
|
2019-11-20 20:40:39 -07:00
|
|
|
<div className='mx_IntegrationsDisabledDialog_content'>
|
2021-07-19 22:43:11 +01:00
|
|
|
<p>{ _t("Enable 'Manage Integrations' in Settings to do this.") }</p>
|
2019-11-20 20:40:39 -07:00
|
|
|
</div>
|
|
|
|
|
<DialogButtons
|
|
|
|
|
primaryButton={_t("Settings")}
|
2021-09-05 16:09:33 +02:00
|
|
|
onPrimaryButtonClick={this.onOpenSettingsClick}
|
2019-11-20 20:40:39 -07:00
|
|
|
cancelButton={_t("OK")}
|
2021-09-05 16:09:33 +02:00
|
|
|
onCancel={this.onAcknowledgeClick}
|
2019-11-20 20:40:39 -07:00
|
|
|
/>
|
|
|
|
|
</BaseDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|