1
0
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:
Leo
2019-11-12 21:59:55 +08:00
committed by Daniel Pan
parent d1dca7d13e
commit 803c15730d
15 changed files with 956 additions and 95 deletions

View 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;