wip wiring up account forms
This commit is contained in:
parent
cdc15f019d
commit
3459bf26f8
25 changed files with 413 additions and 53 deletions
|
|
@ -0,0 +1,29 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { createContainer } from 'meteor/react-meteor-data';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import Documents from '../../../api/Documents/Documents';
|
||||
import DocumentEditor from '../../components/DocumentEditor/DocumentEditor';
|
||||
import NotFound from '../NotFound/NotFound';
|
||||
|
||||
const EditDocument = ({ doc, history }) => (doc ? (
|
||||
<div className="EditDocument">
|
||||
<h4 className="page-header">{`Editing "${doc.title}"`}</h4>
|
||||
<DocumentEditor doc={doc} history={history} />
|
||||
</div>
|
||||
) : <NotFound />);
|
||||
|
||||
EditDocument.propTypes = {
|
||||
doc: PropTypes.object.isRequired,
|
||||
history: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default createContainer(({ match }) => {
|
||||
const documentId = match.params._id;
|
||||
const subscription = Meteor.subscribe('documents.view', documentId);
|
||||
|
||||
return {
|
||||
loading: !subscription.ready(),
|
||||
doc: Documents.findOne(documentId),
|
||||
};
|
||||
}, EditDocument);
|
||||
Loading…
Add table
Add a link
Reference in a new issue