2016-02-25 20:40:35 -08:00
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
2016-05-30 16:55:32 -07:00
|
|
|
import { Map } from 'immutable';
|
|
|
|
import EntryEditor from '../components/EntryEditor';
|
2016-02-25 20:40:35 -08:00
|
|
|
|
|
|
|
class DashboardPage extends React.Component {
|
|
|
|
componentDidMount() {
|
|
|
|
}
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { collection, entry } = this.props;
|
|
|
|
|
2016-05-30 16:55:32 -07:00
|
|
|
return <EntryEditor entry={entry || new Map()} collection={collection}/>;
|
2016-02-25 20:40:35 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
|
|
const { collections } = state;
|
2016-05-30 16:55:32 -07:00
|
|
|
const collection = collections.get(ownProps.params.name);
|
|
|
|
// const entryName = `${collection.get('name')}/${ownProps.params.slug}`;
|
2016-02-25 20:40:35 -08:00
|
|
|
|
|
|
|
return {
|
2016-05-30 16:55:32 -07:00
|
|
|
collection: collection,
|
2016-02-25 20:40:35 -08:00
|
|
|
collections: collections
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(DashboardPage);
|