eslint compliance on container components
This commit is contained in:
parent
dd656e3b38
commit
339c5397b0
@ -76,7 +76,7 @@ function mapStateToProps(state) {
|
|||||||
const { auth, config } = state;
|
const { auth, config } = state;
|
||||||
const user = auth && auth.get('user');
|
const user = auth && auth.get('user');
|
||||||
|
|
||||||
return {auth, config, user};
|
return { auth, config, user };
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps)(App);
|
export default connect(mapStateToProps)(App);
|
||||||
|
@ -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 { Link } from 'react-router';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { loadEntries } from '../actions/entries';
|
import { loadEntries } from '../actions/entries';
|
||||||
@ -23,7 +24,6 @@ class DashboardPage extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { collections, collection, entries } = this.props;
|
const { collections, collection, entries } = this.props;
|
||||||
|
|
||||||
if (collections == null) {
|
if (collections == null) {
|
||||||
return <h1>No collections defined in your config.yml</h1>;
|
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) {
|
function mapStateToProps(state, ownProps) {
|
||||||
const { collections } = state;
|
const { collections } = state;
|
||||||
const { name, slug } = ownProps.params;
|
const { name, slug } = ownProps.params;
|
||||||
const collection = name ? collections.get(name) : collections.first();
|
const collection = name ? collections.get(name) : collections.first();
|
||||||
const entries = selectEntries(state, collection.get('name'));
|
const entries = selectEntries(state, collection.get('name'));
|
||||||
|
|
||||||
return {slug, collection, collections, entries};
|
return { slug, collection, collections, entries };
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps)(DashboardPage);
|
export default connect(mapStateToProps)(DashboardPage);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
loadEntry,
|
loadEntry,
|
||||||
@ -39,6 +40,7 @@ class EntryPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
entry, entryDraft, boundGetMedia, collection, changeDraft, addMedia, removeMedia
|
entry, entryDraft, boundGetMedia, collection, changeDraft, addMedia, removeMedia
|
||||||
} = this.props;
|
} = this.props;
|
||||||
@ -60,13 +62,28 @@ class EntryPage extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EntryPage.propTypes = {
|
||||||
|
addMedia: PropTypes.func.isRequired,
|
||||||
|
boundGetMedia: PropTypes.func.isRequired,
|
||||||
|
changeDraft: PropTypes.func.isRequired,
|
||||||
|
collection: ImmutablePropTypes.map.isRequired,
|
||||||
|
createDraft: PropTypes.func.isRequired,
|
||||||
|
discardDraft: PropTypes.func.isRequired,
|
||||||
|
entry: ImmutablePropTypes.map.isRequired,
|
||||||
|
entryDraft: ImmutablePropTypes.map.isRequired,
|
||||||
|
loadEntry: PropTypes.func.isRequired,
|
||||||
|
persist: PropTypes.func.isRequired,
|
||||||
|
removeMedia: PropTypes.func.isRequired,
|
||||||
|
slug: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
function mapStateToProps(state, ownProps) {
|
function mapStateToProps(state, ownProps) {
|
||||||
const { collections, entryDraft } = state;
|
const { collections, entryDraft } = state;
|
||||||
const collection = collections.get(ownProps.params.name);
|
const collection = collections.get(ownProps.params.name);
|
||||||
const slug = ownProps.params.slug;
|
const slug = ownProps.params.slug;
|
||||||
const entry = selectEntry(state, collection.get('name'), slug);
|
const entry = selectEntry(state, collection.get('name'), slug);
|
||||||
const boundGetMedia = getMedia.bind(null, state);
|
const boundGetMedia = getMedia.bind(null, state);
|
||||||
return {collection, collections, entryDraft, boundGetMedia, slug, entry};
|
return { collection, collections, entryDraft, boundGetMedia, slug, entry };
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user