frontend > app
This commit is contained in:
27
app/components/DocumentList/DocumentList.js
Normal file
27
app/components/DocumentList/DocumentList.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// @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;
|
||||
3
app/components/DocumentList/index.js
Normal file
3
app/components/DocumentList/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
import DocumentList from './DocumentList';
|
||||
export default DocumentList;
|
||||
Reference in New Issue
Block a user