2019-01-31 19:57:57 +03:00
|
|
|
/*
|
|
|
|
Copyright 2015, 2016 OpenMarket Ltd
|
|
|
|
Copyright 2017 New Vector Ltd.
|
2019-02-06 21:27:53 +03:00
|
|
|
Copyright 2019 Bastian Masanek, Noxware IT <matrix@noxware.de>
|
2019-01-31 19:57:57 +03:00
|
|
|
|
|
|
|
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';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import sdk from '../../../index';
|
|
|
|
import { _t } from '../../../languageHandler';
|
|
|
|
|
|
|
|
export default React.createClass({
|
|
|
|
displayName: 'InfoDialog',
|
|
|
|
propTypes: {
|
|
|
|
title: PropTypes.string,
|
|
|
|
description: PropTypes.node,
|
|
|
|
button: PropTypes.string,
|
2019-02-06 21:35:43 +03:00
|
|
|
onFinished: PropTypes.func,
|
2019-01-31 19:57:57 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
getDefaultProps: function() {
|
|
|
|
return {
|
|
|
|
title: "",
|
|
|
|
description: "",
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2019-02-06 21:35:43 +03:00
|
|
|
onFinished: function() {
|
|
|
|
this.props.onFinished();
|
2019-01-31 19:57:57 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
|
|
|
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
|
|
|
|
return (
|
|
|
|
<BaseDialog className="mx_InfoDialog" onFinished={this.props.onFinished}
|
|
|
|
title={this.props.title}
|
|
|
|
contentId='mx_Dialog_content'
|
|
|
|
hasCancel={false}
|
|
|
|
>
|
|
|
|
<div className="mx_Dialog_content" id='mx_Dialog_content'>
|
|
|
|
{ this.props.description }
|
|
|
|
</div>
|
|
|
|
<DialogButtons primaryButton={this.props.button || _t('OK')}
|
2019-02-06 21:35:43 +03:00
|
|
|
onPrimaryButtonClick={this.onFinished}
|
2019-01-31 19:57:57 +03:00
|
|
|
hasCancel={false}
|
|
|
|
>
|
|
|
|
</DialogButtons>
|
|
|
|
</BaseDialog>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|