static-cms/src/containers/EntryPage.js
Mathias Biilmann Christensen 7601d3f5a1 Cleanup
2016-05-30 17:13:40 -07:00

22 lines
583 B
JavaScript

import React from 'react';
import { connect } from 'react-redux';
import { Map } from 'immutable';
import EntryEditor from '../components/EntryEditor';
class EntryPage extends React.Component {
render() {
const { collection, entry } = this.props;
return <EntryEditor entry={entry || new Map()} collection={collection}/>;
}
}
function mapStateToProps(state, ownProps) {
const { collections, media } = state;
const collection = collections.get(ownProps.params.name);
return {media, collection, collections};
}
export default connect(mapStateToProps)(EntryPage);