mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
sysadmin reconstruct terms and conditions pages (#4231)
* sysadmin reconstruct terms and conditions pages * update seafile-js version * add term content dialog * optimized code struct * fix redirect logic after add term * optimized code * optimized code * update seafile-editor version
This commit is contained in:
46
frontend/src/components/dialog/terms-preview-dialog.js
Normal file
46
frontend/src/components/dialog/terms-preview-dialog.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
||||
import ConditionsPreviewWidget from './terms-preview-widget';
|
||||
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'),
|
||||
content: {text: '', perview: ''}
|
||||
}
|
||||
|
||||
|
||||
toggle = () => {
|
||||
this.props.onClosePreviewDialog();
|
||||
}
|
||||
|
||||
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>
|
||||
<ConditionsPreviewWidget content={content} />
|
||||
</ModalBody>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
TermsPreviewDialog.propTypes = propTypes;
|
||||
|
||||
export default TermsPreviewDialog;
|
Reference in New Issue
Block a user