Closes #929 – Clarify pin feature
This commit is contained in:
@@ -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<Props> {
|
||||
document,
|
||||
showCollection,
|
||||
showPublished,
|
||||
showPin,
|
||||
highlight,
|
||||
context,
|
||||
link,
|
||||
@@ -172,7 +174,7 @@ class DocumentPreview extends React.Component<Props> {
|
||||
)}
|
||||
</Actions>
|
||||
)}
|
||||
<StyledDocumentMenu document={document} />
|
||||
<StyledDocumentMenu document={document} showPin={showPin} />
|
||||
</Heading>
|
||||
{!queryIsInTitle && (
|
||||
<ResultContext
|
||||
|
||||
@@ -19,6 +19,7 @@ type Props = {
|
||||
className: string,
|
||||
showPrint?: boolean,
|
||||
showToggleEmbeds?: boolean,
|
||||
showPin?: boolean,
|
||||
};
|
||||
|
||||
@observer
|
||||
@@ -97,7 +98,7 @@ class DocumentMenu extends React.Component<Props> {
|
||||
render() {
|
||||
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||
|
||||
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<Props> {
|
||||
<DropdownMenu label={label || <MoreIcon />} className={className}>
|
||||
{!document.isDraft ? (
|
||||
<React.Fragment>
|
||||
{document.pinned ? (
|
||||
<DropdownMenuItem onClick={this.handleUnpin}>
|
||||
Unpin
|
||||
</DropdownMenuItem>
|
||||
) : (
|
||||
<DropdownMenuItem onClick={this.handlePin}>Pin</DropdownMenuItem>
|
||||
)}
|
||||
{showPin &&
|
||||
(document.pinned ? (
|
||||
<DropdownMenuItem onClick={this.handleUnpin}>
|
||||
Unpin
|
||||
</DropdownMenuItem>
|
||||
) : (
|
||||
<DropdownMenuItem onClick={this.handlePin}>
|
||||
Pin to collection
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
{document.starred ? (
|
||||
<DropdownMenuItem onClick={this.handleUnstar}>
|
||||
Unstar
|
||||
|
||||
@@ -195,7 +195,7 @@ class CollectionScene extends React.Component<Props> {
|
||||
<Subheading>
|
||||
<TinyPinIcon size={18} /> Pinned
|
||||
</Subheading>
|
||||
<DocumentList documents={pinnedDocuments} />
|
||||
<DocumentList documents={pinnedDocuments} showPin />
|
||||
</React.Fragment>
|
||||
)}
|
||||
|
||||
@@ -222,6 +222,7 @@ class CollectionScene extends React.Component<Props> {
|
||||
)}
|
||||
fetch={documents.fetchAlphabetical}
|
||||
options={{ collection: collection.id }}
|
||||
showPin
|
||||
/>
|
||||
</Route>
|
||||
<Route path={collectionUrl(collection.id, 'old')}>
|
||||
@@ -232,6 +233,7 @@ class CollectionScene extends React.Component<Props> {
|
||||
)}
|
||||
fetch={documents.fetchLeastRecentlyUpdated}
|
||||
options={{ collection: collection.id }}
|
||||
showPin
|
||||
/>
|
||||
</Route>
|
||||
<Route path={collectionUrl(collection.id, 'recent')}>
|
||||
@@ -243,6 +245,7 @@ class CollectionScene extends React.Component<Props> {
|
||||
fetch={documents.fetchRecentlyPublished}
|
||||
options={{ collection: collection.id }}
|
||||
showPublished
|
||||
showPin
|
||||
/>
|
||||
</Route>
|
||||
<Route path={collectionUrl(collection.id)}>
|
||||
@@ -252,6 +255,7 @@ class CollectionScene extends React.Component<Props> {
|
||||
)}
|
||||
fetch={documents.fetchRecentlyUpdated}
|
||||
options={{ collection: collection.id }}
|
||||
showPin
|
||||
/>
|
||||
</Route>
|
||||
</Switch>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user