eslint compliance on presentational components

This commit is contained in:
Cássio Zen
2016-06-16 19:20:36 -03:00
parent 8e7de6a64f
commit 37cf1ba52d
14 changed files with 134 additions and 87 deletions

View File

@ -1,19 +1,21 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { Link } from 'react-router';
export default class EntryListing extends React.Component {
render() {
const { collection, entries } = this.props;
const name = collection.get('name');
return <div>
<h2>Listing entries!</h2>
{entries.map((entry) => {
const path = `/collections/${name}/entries/${entry.get('slug')}`;
return <Link key={entry.get('slug')} to={path}>
<h3>{entry.getIn(['data', 'title'])}</h3>
</Link>;
})}
</div>;
}
export default function EntryListing({ collection, entries }) {
const name = collection.get('name');
return <div>
<h2>Listing entries!</h2>
{entries.map((entry) => {
const path = `/collections/${name}/entries/${entry.get('slug')}`;
return <Link key={entry.get('slug')} to={path}>
<h3>{entry.getIn(['data', 'title'])}</h3>
</Link>;
})}
</div>;
}
EntryListing.propTypes = {
collection: ImmutablePropTypes.map.isRequired,
entries: ImmutablePropTypes.list,
};