eslint compliance on container components
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { Link } from 'react-router';
|
||||
import { connect } from 'react-redux';
|
||||
import { loadEntries } from '../actions/entries';
|
||||
@ -23,7 +24,6 @@ class DashboardPage extends React.Component {
|
||||
|
||||
render() {
|
||||
const { collections, collection, entries } = this.props;
|
||||
|
||||
if (collections == null) {
|
||||
return <h1>No collections defined in your config.yml</h1>;
|
||||
}
|
||||
@ -44,13 +44,20 @@ class DashboardPage extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
DashboardPage.propTypes = {
|
||||
collection: ImmutablePropTypes.map.isRequired,
|
||||
collections: ImmutablePropTypes.orderedMap.isRequired,
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
entries: ImmutablePropTypes.list,
|
||||
};
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
const { collections } = state;
|
||||
const { name, slug } = ownProps.params;
|
||||
const collection = name ? collections.get(name) : collections.first();
|
||||
const entries = selectEntries(state, collection.get('name'));
|
||||
|
||||
return {slug, collection, collections, entries};
|
||||
return { slug, collection, collections, entries };
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(DashboardPage);
|
||||
|
Reference in New Issue
Block a user