mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
make share banner appear only if user has the power to share this project
This commit is contained in:
parent
e14cb0f8f2
commit
7aae4219ec
2 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue