diff --git a/app/components/DocumentPreview/DocumentPreview.js b/app/components/DocumentPreview/DocumentPreview.js index e41806fc3..1f8e10fe1 100644 --- a/app/components/DocumentPreview/DocumentPreview.js +++ b/app/components/DocumentPreview/DocumentPreview.js @@ -17,6 +17,7 @@ type Props = { context?: ?string, showCollection?: boolean, showPublished?: boolean, + showPin?: boolean, link?: boolean, ref?: *, }; @@ -137,6 +138,7 @@ class DocumentPreview extends React.Component { document, showCollection, showPublished, + showPin, highlight, context, link, @@ -172,7 +174,7 @@ class DocumentPreview extends React.Component { )} )} - + {!queryIsInTitle && ( { render() { if (this.redirectTo) return ; - const { document, label, className, showPrint, auth } = this.props; + const { document, label, className, showPrint, showPin, auth } = this.props; const canShareDocuments = auth.team && auth.team.sharing; if (document.isArchived) { @@ -117,13 +118,16 @@ class DocumentMenu extends React.Component { } className={className}> {!document.isDraft ? ( - {document.pinned ? ( - - Unpin - - ) : ( - Pin - )} + {showPin && + (document.pinned ? ( + + Unpin + + ) : ( + + Pin to collection + + ))} {document.starred ? ( Unstar diff --git a/app/scenes/Collection.js b/app/scenes/Collection.js index 1200c35b4..00c871198 100644 --- a/app/scenes/Collection.js +++ b/app/scenes/Collection.js @@ -195,7 +195,7 @@ class CollectionScene extends React.Component { Pinned - + )} @@ -222,6 +222,7 @@ class CollectionScene extends React.Component { )} fetch={documents.fetchAlphabetical} options={{ collection: collection.id }} + showPin /> @@ -232,6 +233,7 @@ class CollectionScene extends React.Component { )} fetch={documents.fetchLeastRecentlyUpdated} options={{ collection: collection.id }} + showPin /> @@ -243,6 +245,7 @@ class CollectionScene extends React.Component { fetch={documents.fetchRecentlyPublished} options={{ collection: collection.id }} showPublished + showPin /> @@ -252,6 +255,7 @@ class CollectionScene extends React.Component { )} fetch={documents.fetchRecentlyUpdated} options={{ collection: collection.id }} + showPin /> diff --git a/yarn.lock b/yarn.lock index eeb5b6ef9..cf92919b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7738,6 +7738,7 @@ retry-axios@0.3.2, retry-axios@^0.3.2: rich-markdown-editor@^9.1.2: version "9.1.2" resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-9.1.2.tgz#869d2a66d93b84ae6878ad3917dd3a012cffb721" + integrity sha512-Sv9svBpH+rVktpNjD/73IpVTVE3atKVLt+Kdcx+o/DRkvJPdXwJkMYXM2jE8IIBRafgdGS/X6JZImVlsX5uHxQ== dependencies: "@tommoor/slate-edit-list" "0.19.0-0" "@wikifactory/slate-edit-blockquote" "^0.7.1"