2019-11-12 13:59:55 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
2019-11-20 09:48:39 +00:00
|
|
|
import TermsPreviewWidget from '../terms-preview-widget';
|
2019-11-12 13:59:55 +00:00
|
|
|
import { gettext } from '../../utils/constants';
|
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
title: PropTypes.string,
|
|
|
|
content: PropTypes.string,
|
|
|
|
onClosePreviewDialog: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
class TermsPreviewDialog extends React.Component {
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
title: gettext('Terms'),
|
2023-09-13 00:40:50 +00:00
|
|
|
};
|
2019-11-12 13:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
toggle = () => {
|
|
|
|
this.props.onClosePreviewDialog();
|
2023-09-13 00:40:50 +00:00
|
|
|
};
|
2019-11-12 13:59:55 +00:00
|
|
|
|
|
|
|
render() {
|
|
|
|
let { title, content } = this.props;
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
isOpen={true}
|
|
|
|
size={'lg'}
|
|
|
|
style={{width: 600}}
|
|
|
|
wrapClassName={'conditions-perview-wrapper'}
|
|
|
|
toggle={this.toggle}
|
|
|
|
>
|
|
|
|
<ModalHeader toggle={this.toggle}>{title}</ModalHeader>
|
|
|
|
<ModalBody>
|
2019-11-16 11:21:15 +00:00
|
|
|
<TermsPreviewWidget content={content} />
|
2019-11-12 13:59:55 +00:00
|
|
|
</ModalBody>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TermsPreviewDialog.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default TermsPreviewDialog;
|