feat: document menu available in sidebar (#986)
* feat: document menu available in sidebar * fix: more accessible blue * feat: accessible blue feat: clearer new doc button closes #983 * lint
This commit is contained in:
@@ -7,6 +7,7 @@ import Collection from 'models/Collection';
|
||||
import Document from 'models/Document';
|
||||
import CollectionMenu from 'menus/CollectionMenu';
|
||||
import UiStore from 'stores/UiStore';
|
||||
import DocumentsStore from 'stores/DocumentsStore';
|
||||
import SidebarLink from './SidebarLink';
|
||||
import DocumentLink from './DocumentLink';
|
||||
import DropToImport from 'components/DropToImport';
|
||||
@@ -15,6 +16,7 @@ import Flex from 'shared/components/Flex';
|
||||
type Props = {
|
||||
collection: Collection,
|
||||
ui: UiStore,
|
||||
documents: DocumentsStore,
|
||||
activeDocument: ?Document,
|
||||
prefetchDocument: (id: string) => *,
|
||||
};
|
||||
@@ -24,7 +26,13 @@ class CollectionLink extends React.Component<Props> {
|
||||
@observable menuOpen = false;
|
||||
|
||||
render() {
|
||||
const { collection, activeDocument, prefetchDocument, ui } = this.props;
|
||||
const {
|
||||
collection,
|
||||
documents,
|
||||
activeDocument,
|
||||
prefetchDocument,
|
||||
ui,
|
||||
} = this.props;
|
||||
const expanded = collection.id === ui.activeCollectionId;
|
||||
|
||||
return (
|
||||
@@ -54,6 +62,7 @@ class CollectionLink extends React.Component<Props> {
|
||||
exact={false}
|
||||
menu={
|
||||
<CollectionMenu
|
||||
position="left"
|
||||
collection={collection}
|
||||
onOpen={() => (this.menuOpen = true)}
|
||||
onClose={() => (this.menuOpen = false)}
|
||||
@@ -61,10 +70,11 @@ class CollectionLink extends React.Component<Props> {
|
||||
}
|
||||
>
|
||||
<Flex column>
|
||||
{collection.documents.map(document => (
|
||||
{collection.documents.map(node => (
|
||||
<DocumentLink
|
||||
key={document.id}
|
||||
document={document}
|
||||
key={node.id}
|
||||
node={node}
|
||||
documents={documents}
|
||||
collection={collection}
|
||||
activeDocument={activeDocument}
|
||||
prefetchDocument={prefetchDocument}
|
||||
|
||||
Reference in New Issue
Block a user