make share banner appear only if user has the power to share this project

This commit is contained in:
Ben Wheeler 2018-11-01 14:19:28 -04:00
parent e14cb0f8f2
commit 7aae4219ec
2 changed files with 4 additions and 1 deletions

View file

@ -48,6 +48,7 @@ const PreviewPresentation = ({
canDeleteComments,
canReport,
canRestoreComments,
canShare,
cloudHost,
comments,
editable,
@ -94,7 +95,7 @@ const PreviewPresentation = ({
const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : '';
return (
<div className="preview">
{!isShared && (
{canShare && !isShared && (
<ShareBanner onShare={onShare} />
)}
{ projectInfo && projectInfo.author && projectInfo.author.id && (
@ -440,6 +441,7 @@ PreviewPresentation.propTypes = {
canDeleteComments: PropTypes.bool,
canReport: PropTypes.bool,
canRestoreComments: PropTypes.bool,
canShare: PropTypes.bool,
cloudHost: PropTypes.string,
comments: PropTypes.arrayOf(PropTypes.object),
editable: PropTypes.bool,

View file

@ -405,6 +405,7 @@ class Preview extends React.Component {
canDeleteComments={this.props.isAdmin || this.props.userOwnsProject}
canReport={this.props.canReport}
canRestoreComments={this.props.isAdmin}
canShare={this.props.canShare}
cloudHost={this.props.cloudHost}
comments={this.props.comments}
editable={this.props.isEditable}