Closes #929 – Clarify pin feature

This commit is contained in:
Tom Moor
2019-04-08 21:47:27 -07:00
parent 763f57a3dc
commit a3ca3447d1
4 changed files with 21 additions and 10 deletions

View File

@@ -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