This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/frontend/components/DocumentList/DocumentList.js
Tom Moor 8558b92cae Edit collection (#173)
* Collection edit modal

* Add icon

* 💚

* Oh look, some specs

* Delete collection

* Remove from collection

* Handle error responses
Protect against deleting last collection

* Fix key

* 💚

* Keyboard navigate documents list

* Add missing database constraints
2017-08-29 08:37:17 -07:00

28 lines
675 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: Array<Document>,
};
render() {
return (
<ArrowKeyNavigation
mode={ArrowKeyNavigation.mode.VERTICAL}
defaultActiveChildIndex={0}
>
{this.props.documents &&
this.props.documents.map(document => (
<DocumentPreview key={document.id} document={document} />
))}
</ArrowKeyNavigation>
);
}
}
export default DocumentList;