mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Restrict reporting comments to logged in users
This commit is contained in:
parent
7b514344fa
commit
312a9e2bff
3 changed files with 15 additions and 6 deletions
|
@ -87,6 +87,7 @@ class Comment extends React.Component {
|
|||
author,
|
||||
canDelete,
|
||||
canReply,
|
||||
canReport,
|
||||
canRestore,
|
||||
content,
|
||||
datetimeCreated,
|
||||
|
@ -122,12 +123,14 @@ class Comment extends React.Component {
|
|||
<FormattedMessage id="comments.delete" />
|
||||
</span>
|
||||
)}
|
||||
<span
|
||||
className="comment-report"
|
||||
onClick={this.handleReport}
|
||||
>
|
||||
<FormattedMessage id="comments.report" />
|
||||
</span>
|
||||
{canReport && (
|
||||
<span
|
||||
className="comment-report"
|
||||
onClick={this.handleReport}
|
||||
>
|
||||
<FormattedMessage id="comments.report" />
|
||||
</span>
|
||||
)}
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
|
@ -215,6 +218,7 @@ Comment.propTypes = {
|
|||
}),
|
||||
canDelete: PropTypes.bool,
|
||||
canReply: PropTypes.bool,
|
||||
canReport: PropTypes.bool,
|
||||
canRestore: PropTypes.bool,
|
||||
content: PropTypes.string,
|
||||
datetimeCreated: PropTypes.string,
|
||||
|
|
|
@ -55,6 +55,7 @@ class TopLevelComment extends React.Component {
|
|||
author,
|
||||
canDelete,
|
||||
canReply,
|
||||
canReport,
|
||||
canRestore,
|
||||
content,
|
||||
datetimeCreated,
|
||||
|
@ -80,6 +81,7 @@ class TopLevelComment extends React.Component {
|
|||
datetimeCreated,
|
||||
canDelete,
|
||||
canReply,
|
||||
canReport,
|
||||
canRestore,
|
||||
id,
|
||||
onDelete,
|
||||
|
@ -102,6 +104,7 @@ class TopLevelComment extends React.Component {
|
|||
author={reply.author}
|
||||
canDelete={canDelete}
|
||||
canReply={canReply}
|
||||
canReport={canReport}
|
||||
canRestore={canRestore && parentVisible}
|
||||
content={reply.content}
|
||||
datetimeCreated={reply.datetime_created}
|
||||
|
@ -143,6 +146,7 @@ TopLevelComment.propTypes = {
|
|||
}),
|
||||
canDelete: PropTypes.bool,
|
||||
canReply: PropTypes.bool,
|
||||
canReport: PropTypes.bool,
|
||||
canRestore: PropTypes.bool,
|
||||
content: PropTypes.string,
|
||||
datetimeCreated: PropTypes.string,
|
||||
|
|
|
@ -367,6 +367,7 @@ const PreviewPresentation = ({
|
|||
author={comment.author}
|
||||
canDelete={canDeleteComments}
|
||||
canReply={isLoggedIn && projectInfo.comments_allowed}
|
||||
canReport={isLoggedIn}
|
||||
canRestore={canRestoreComments}
|
||||
content={comment.content}
|
||||
datetimeCreated={comment.datetime_created}
|
||||
|
|
Loading…
Reference in a new issue