mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #2424 from paulkaplan/admin-toggle-comments
Allow admins to toggle comments
This commit is contained in:
commit
d20b16d79c
2 changed files with 6 additions and 4 deletions
|
@ -57,6 +57,7 @@ const PreviewPresentation = ({
|
|||
canRestoreComments,
|
||||
canSave,
|
||||
canShare,
|
||||
canToggleComments,
|
||||
canUseBackpack,
|
||||
cloudHost,
|
||||
comments,
|
||||
|
@ -113,7 +114,6 @@ const PreviewPresentation = ({
|
|||
showAdminPanel,
|
||||
showModInfo,
|
||||
singleCommentId,
|
||||
userOwnsProject,
|
||||
visibilityInfo
|
||||
}) => {
|
||||
const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : '';
|
||||
|
@ -480,7 +480,7 @@ const PreviewPresentation = ({
|
|||
<div className="comments-container">
|
||||
<FlexRow className="comments-header">
|
||||
<h4><FormattedMessage id="project.comments.header" /></h4>
|
||||
{userOwnsProject ? (
|
||||
{canToggleComments ? (
|
||||
<div>
|
||||
<label>
|
||||
<input
|
||||
|
@ -584,6 +584,7 @@ PreviewPresentation.propTypes = {
|
|||
canRestoreComments: PropTypes.bool,
|
||||
canSave: PropTypes.bool,
|
||||
canShare: PropTypes.bool,
|
||||
canToggleComments: PropTypes.bool,
|
||||
canUseBackpack: PropTypes.bool,
|
||||
cloudHost: PropTypes.string,
|
||||
comments: PropTypes.arrayOf(PropTypes.object),
|
||||
|
@ -643,7 +644,6 @@ PreviewPresentation.propTypes = {
|
|||
showAdminPanel: PropTypes.bool,
|
||||
showModInfo: PropTypes.bool,
|
||||
singleCommentId: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
|
||||
userOwnsProject: PropTypes.bool,
|
||||
visibilityInfo: PropTypes.shape({
|
||||
censored: PropTypes.bool,
|
||||
message: PropTypes.string,
|
||||
|
|
|
@ -547,6 +547,7 @@ class Preview extends React.Component {
|
|||
canRestoreComments={this.props.isAdmin}
|
||||
canSave={this.props.canSave}
|
||||
canShare={this.props.canShare || this.props.isAdmin}
|
||||
canToggleComments={this.props.canToggleComments}
|
||||
canUseBackpack={this.props.canUseBackpack}
|
||||
cloudHost={this.props.cloudHost}
|
||||
comments={this.props.comments}
|
||||
|
@ -578,7 +579,6 @@ class Preview extends React.Component {
|
|||
showAdminPanel={this.props.isAdmin}
|
||||
showModInfo={this.props.isAdmin}
|
||||
singleCommentId={this.state.singleCommentId}
|
||||
userOwnsProject={this.props.userOwnsProject}
|
||||
visibilityInfo={this.props.visibilityInfo}
|
||||
onAddComment={this.handleAddComment}
|
||||
onAddToStudioClicked={this.handleAddToStudioClick}
|
||||
|
@ -663,6 +663,7 @@ Preview.propTypes = {
|
|||
canReport: PropTypes.bool,
|
||||
canSave: PropTypes.bool,
|
||||
canShare: PropTypes.bool,
|
||||
canToggleComments: PropTypes.bool,
|
||||
canUseBackpack: PropTypes.bool,
|
||||
cloudHost: PropTypes.string,
|
||||
comments: PropTypes.arrayOf(PropTypes.object),
|
||||
|
@ -778,6 +779,7 @@ const mapStateToProps = state => {
|
|||
canReport: isLoggedIn && !userOwnsProject,
|
||||
canSave: isLoggedIn && userOwnsProject,
|
||||
canShare: userOwnsProject && state.permissions.social,
|
||||
canToggleComments: userOwnsProject || isAdmin,
|
||||
canUseBackpack: isLoggedIn,
|
||||
comments: state.preview.comments,
|
||||
enableCommunity: projectInfoPresent,
|
||||
|
|
Loading…
Reference in a new issue