* WIP: Archive * WIP * Finishing up archive endpoints * WIP * Update docs * Flow * Stash * Add toast message confirmations * Redirect handling, fixed publishhing info for archived docs * Redirect to collection instead of home, remove unused pub info * Account for deleted parent * Trash -> Archive Allow reading of archived docs * Dont overload deletedAt * Fixes * 💚 * ParentDocumentId wipe for unarchived sub docs * Fix: CMD+S exits editing Fix: Duplicate user name on published but unedited docs * Improve jank on paginated lists * Prevent editing when archived * 💚 Separate lint / flow steps
26 lines
680 B
JavaScript
26 lines
680 B
JavaScript
// @flow
|
|
import * as React from 'react';
|
|
import Document from 'models/Document';
|
|
import DocumentPreview from 'components/DocumentPreview';
|
|
import ArrowKeyNavigation from 'boundless-arrow-key-navigation';
|
|
|
|
type Props = {
|
|
documents: Document[],
|
|
limit?: number,
|
|
};
|
|
|
|
export default function DocumentList({ limit, documents, ...rest }: Props) {
|
|
const items = limit ? documents.splice(0, limit) : documents;
|
|
|
|
return (
|
|
<ArrowKeyNavigation
|
|
mode={ArrowKeyNavigation.mode.VERTICAL}
|
|
defaultActiveChildIndex={0}
|
|
>
|
|
{items.map(document => (
|
|
<DocumentPreview key={document.id} document={document} {...rest} />
|
|
))}
|
|
</ArrowKeyNavigation>
|
|
);
|
|
}
|