Restore New Document Functionality (#94)

* Restored New Document functionality

* Declarative SidebarHidden

* Fix edit route
This commit is contained in:
Tom Moor
2017-07-04 23:02:06 -07:00
committed by GitHub
parent 88cdbc413a
commit 1c83257483
8 changed files with 111 additions and 72 deletions

View File

@ -16,9 +16,7 @@ type Props = {
props: Props;
onCreateDocument = () => {
// Disabled until created a better API
// invariant(this.props.collectionTree, 'collectionTree is not available');
// this.props.history.push(`${this.props.collectionTree.url}/new`);
this.props.history.push(`${this.props.document.collection.url}/new`);
};
onCreateChild = () => {
@ -68,7 +66,6 @@ type Props = {
<MenuItem onClick={this.onCreateDocument}>
New document
</MenuItem>
<MenuItem onClick={this.onCreateChild}>New child</MenuItem>
</div>}
<MenuItem onClick={this.onExport}>Export</MenuItem>
{allowDelete && <MenuItem onClick={this.onDelete}>Delete</MenuItem>}