2016-02-25 20:40:35 -08:00
|
|
|
import React from 'react';
|
2016-06-16 19:20:36 -03:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2016-02-25 20:40:35 -08:00
|
|
|
import { Link } from 'react-router';
|
|
|
|
|
2016-06-16 19:20:36 -03:00
|
|
|
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>;
|
2016-02-25 20:40:35 -08:00
|
|
|
}
|
2016-06-16 19:20:36 -03:00
|
|
|
|
|
|
|
EntryListing.propTypes = {
|
|
|
|
collection: ImmutablePropTypes.map.isRequired,
|
|
|
|
entries: ImmutablePropTypes.list,
|
|
|
|
};
|