unpublished items dashboard
This commit is contained in:
45
src/components/UnpublishedListing.js
Normal file
45
src/components/UnpublishedListing.js
Normal file
@ -0,0 +1,45 @@
|
||||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { Card } from './UI';
|
||||
import { statusDescriptions } from '../constants/publishModes';
|
||||
|
||||
export default class UnpublishedListing extends React.Component {
|
||||
renderColumn(entries) {
|
||||
if (!entries) return;
|
||||
return (
|
||||
<div>
|
||||
{entries.map(entry => {
|
||||
return <Card key={entry.get('slug')}><h4>{entry.getIn(['data', 'title'])}</h4></Card>;
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { entries } = this.props;
|
||||
const columns = entries.entrySeq().map(([key, currEntries]) => (
|
||||
<div key={key}>
|
||||
<h3>{statusDescriptions.get(key)}</h3>
|
||||
{this.renderColumn(currEntries)}
|
||||
</div>
|
||||
));
|
||||
|
||||
return (
|
||||
<div>
|
||||
{columns}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
UnpublishedListing.propTypes = {
|
||||
entries: ImmutablePropTypes.map,
|
||||
};
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<h3>Drafts</h3>
|
||||
<card>Cool Recipe</card>
|
||||
</div>
|
Reference in New Issue
Block a user