|
| 1 | +/* |
| 2 | +Copyright 2019 The Matrix.org Foundation C.I.C. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +import React from 'react'; |
| 18 | +import PropTypes from 'prop-types'; |
| 19 | +import {_t} from "../../../languageHandler"; |
| 20 | +import sdk from "../../../index"; |
| 21 | +import dis from '../../../dispatcher'; |
| 22 | + |
| 23 | +export default class IntegrationsDisabledDialog extends React.Component { |
| 24 | + static propTypes = { |
| 25 | + onFinished: PropTypes.func.isRequired, |
| 26 | + }; |
| 27 | + |
| 28 | + _onAcknowledgeClick = () => { |
| 29 | + this.props.onFinished(); |
| 30 | + }; |
| 31 | + |
| 32 | + _onOpenSettingsClick = () => { |
| 33 | + this.props.onFinished(); |
| 34 | + dis.dispatch({action: "view_user_settings"}); |
| 35 | + }; |
| 36 | + |
| 37 | + render() { |
| 38 | + const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); |
| 39 | + const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); |
| 40 | + |
| 41 | + return ( |
| 42 | + <BaseDialog className='mx_IntegrationsDisabledDialog' hasCancel={true} |
| 43 | + onFinished={this.props.onFinished} |
| 44 | + title={_t("Integrations are disabled")}> |
| 45 | + <div className='mx_IntegrationsDisabledDialog_content'> |
| 46 | + <p>{_t("Enable 'Manage Integrations' in Settings to do this.")}</p> |
| 47 | + </div> |
| 48 | + <DialogButtons |
| 49 | + primaryButton={_t("Settings")} |
| 50 | + onPrimaryButtonClick={this._onOpenSettingsClick} |
| 51 | + cancelButton={_t("OK")} |
| 52 | + onCancel={this._onAcknowledgeClick} |
| 53 | + /> |
| 54 | + </BaseDialog> |
| 55 | + ); |
| 56 | + } |
| 57 | +} |
0 commit comments