* Migrations and API for pinned documents * Documentation * Add pin icon * Fin. * v0.2.0 * Remove pin from DocumentPreview, add general menu Add Pinned documents header * Tidy * Fixed: Drafts appearing on collection home
38 lines
904 B
JavaScript
38 lines
904 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,
|
|
limit?: number,
|
|
};
|
|
|
|
render() {
|
|
const { limit, showCollection } = this.props;
|
|
const documents = limit
|
|
? this.props.documents.splice(0, limit)
|
|
: this.props.documents;
|
|
|
|
return (
|
|
<ArrowKeyNavigation
|
|
mode={ArrowKeyNavigation.mode.VERTICAL}
|
|
defaultActiveChildIndex={0}
|
|
>
|
|
{documents.map(document => (
|
|
<DocumentPreview
|
|
key={document.id}
|
|
document={document}
|
|
showCollection={showCollection}
|
|
/>
|
|
))}
|
|
</ArrowKeyNavigation>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default DocumentList;
|