* Mostly there * Fix up specs * Working scope, updated tests * Don't record view on draft * PR feedback * Highlight drafts nav item * Bugaboos * Styling * Refactoring, gradually addressing Jori feedback * Show collection in drafts list Flow fixes * Ensure menu actions are hidden when draft
35 lines
819 B
JavaScript
35 lines
819 B
JavaScript
// @flow
|
|
import React from 'react';
|
|
import Document from 'models/Document';
|
|
import DocumentPreview from 'components/DocumentPreview';
|
|
import ArrowKeyNavigation from 'boundless-arrow-key-navigation';
|
|
|
|
class DocumentList extends React.Component {
|
|
props: {
|
|
documents: Document[],
|
|
showCollection?: boolean,
|
|
};
|
|
|
|
render() {
|
|
const { documents, showCollection } = this.props;
|
|
|
|
return (
|
|
<ArrowKeyNavigation
|
|
mode={ArrowKeyNavigation.mode.VERTICAL}
|
|
defaultActiveChildIndex={0}
|
|
>
|
|
{documents &&
|
|
documents.map(document => (
|
|
<DocumentPreview
|
|
key={document.id}
|
|
document={document}
|
|
showCollection={showCollection}
|
|
/>
|
|
))}
|
|
</ArrowKeyNavigation>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default DocumentList;
|