Basic editing with some widgets

This commit is contained in:
Mathias Biilmann Christensen
2016-05-30 16:55:32 -07:00
parent 978b7290c5
commit d2aa1adf7b
23 changed files with 307 additions and 32 deletions

View File

@ -1,8 +1,7 @@
import React from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { loadEntries } from '../actions/entries';
import EntryListing from '../components/EntryListing';
import { Map } from 'immutable';
import EntryEditor from '../components/EntryEditor';
class DashboardPage extends React.Component {
componentDidMount() {
@ -14,18 +13,17 @@ class DashboardPage extends React.Component {
render() {
const { collection, entry } = this.props;
return <div>
<h1>Entry in {collection.get('label')}</h1>
<h2>{entry && entry.get('title')}</h2>
</div>;
return <EntryEditor entry={entry || new Map()} collection={collection}/>;
}
}
function mapStateToProps(state, ownProps) {
const { collections } = state;
const collection = collections.get(ownProps.params.name);
// const entryName = `${collection.get('name')}/${ownProps.params.slug}`;
return {
collection: collections.get(ownProps.params.name),
collection: collection,
collections: collections
};
}