Pinned documents (#608)

* 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
This commit is contained in:
Tom Moor
2018-02-28 23:28:36 -08:00
committed by GitHub
parent 1722b3f3d9
commit 18b0338736
16 changed files with 399 additions and 101 deletions

View File

@@ -8,24 +8,27 @@ class DocumentList extends React.Component {
props: {
documents: Document[],
showCollection?: boolean,
limit?: number,
};
render() {
const { documents, showCollection } = this.props;
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 &&
documents.map(document => (
<DocumentPreview
key={document.id}
document={document}
showCollection={showCollection}
/>
))}
{documents.map(document => (
<DocumentPreview
key={document.id}
document={document}
showCollection={showCollection}
/>
))}
</ArrowKeyNavigation>
);
}