corrections found while writing documentation
This commit is contained in:
parent
5485eb9260
commit
ab22ebc967
17 changed files with 127 additions and 42 deletions
|
|
@ -7,6 +7,7 @@ import { Meteor } from 'meteor/meteor';
|
|||
import { createContainer } from 'meteor/react-meteor-data';
|
||||
import { Bert } from 'meteor/themeteorchef:bert';
|
||||
import DocumentsCollection from '../../../api/Documents/Documents';
|
||||
import Loading from '../../components/Loading/Loading';
|
||||
|
||||
import './Documents.scss';
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ const handleRemove = (documentId) => {
|
|||
}
|
||||
};
|
||||
|
||||
const Documents = ({ documents, match, history }) => (
|
||||
const Documents = ({ loading, documents, match, history }) => (!loading ? (
|
||||
<div className="Documents">
|
||||
<div className="page-header clearfix">
|
||||
<h4 className="pull-left">Documents</h4>
|
||||
|
|
@ -63,9 +64,10 @@ const Documents = ({ documents, match, history }) => (
|
|||
</tbody>
|
||||
</Table> : <Alert bsStyle="warning">No documents yet!</Alert>}
|
||||
</div>
|
||||
);
|
||||
) : <Loading />);
|
||||
|
||||
Documents.propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
documents: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
match: PropTypes.object.isRequired,
|
||||
history: PropTypes.object.isRequired,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { Meteor } from 'meteor/meteor';
|
|||
import { Bert } from 'meteor/themeteorchef:bert';
|
||||
import Documents from '../../../api/Documents/Documents';
|
||||
import NotFound from '../NotFound/NotFound';
|
||||
import Loading from '../../components/Loading/Loading';
|
||||
|
||||
const handleRemove = (documentId, history) => {
|
||||
if (confirm('Are you sure? This is permanent!')) {
|
||||
|
|
@ -20,7 +21,7 @@ const handleRemove = (documentId, history) => {
|
|||
}
|
||||
};
|
||||
|
||||
const ViewDocument = ({ doc, match, history }) => (doc ? (
|
||||
const renderDocument = (doc, match, history) => (doc ? (
|
||||
<div className="ViewDocument">
|
||||
<div className="page-header clearfix">
|
||||
<h4 className="pull-left">{ doc && doc.title }</h4>
|
||||
|
|
@ -37,7 +38,12 @@ const ViewDocument = ({ doc, match, history }) => (doc ? (
|
|||
</div>
|
||||
) : <NotFound />);
|
||||
|
||||
const ViewDocument = ({ loading, doc, match, history }) => (
|
||||
!loading ? renderDocument(doc, match, history) : <Loading />
|
||||
);
|
||||
|
||||
ViewDocument.propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
doc: PropTypes.object.isRequired,
|
||||
match: PropTypes.object.isRequired,
|
||||
history: PropTypes.object.isRequired,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue