mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Merge pull request #2198 from paulkaplan/fix-comment-msg
Comment minor fixes
This commit is contained in:
commit
505dda09ae
5 changed files with 20 additions and 7 deletions
|
@ -238,6 +238,7 @@
|
|||
"comments.status.delbyclass": "Deleted by class",
|
||||
"comments.status.hiddenduetourl": "Hidden due to URL",
|
||||
"comments.status.markedbyfilter": "Marked by filter",
|
||||
"comments.status.censbyunconstructive": "Censored unconstructive",
|
||||
"comments.status.suspended": "Suspended",
|
||||
"comments.status.acctdel": "Account deleted",
|
||||
"comments.status.deleted": "Deleted",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -45,6 +45,7 @@ const PreviewPresentation = ({
|
|||
assetHost,
|
||||
backpackOptions,
|
||||
canAddToStudio,
|
||||
canDeleteComments,
|
||||
canReport,
|
||||
canRestoreComments,
|
||||
comments,
|
||||
|
@ -364,8 +365,9 @@ const PreviewPresentation = ({
|
|||
{comments.map(comment => (
|
||||
<TopLevelComment
|
||||
author={comment.author}
|
||||
canDelete={userOwnsProject}
|
||||
canDelete={canDeleteComments}
|
||||
canReply={isLoggedIn && projectInfo.comments_allowed}
|
||||
canReport={isLoggedIn}
|
||||
canRestore={canRestoreComments}
|
||||
content={comment.content}
|
||||
datetimeCreated={comment.datetime_created}
|
||||
|
@ -412,6 +414,7 @@ PreviewPresentation.propTypes = {
|
|||
visible: PropTypes.bool
|
||||
}),
|
||||
canAddToStudio: PropTypes.bool,
|
||||
canDeleteComments: PropTypes.bool,
|
||||
canReport: PropTypes.bool,
|
||||
canRestoreComments: PropTypes.bool,
|
||||
comments: PropTypes.arrayOf(PropTypes.object),
|
||||
|
|
|
@ -350,6 +350,7 @@ class Preview extends React.Component {
|
|||
assetHost={this.props.assetHost}
|
||||
backpackOptions={this.props.backpackOptions}
|
||||
canAddToStudio={this.props.canAddToStudio}
|
||||
canDeleteComments={this.props.isAdmin || this.props.userOwnsProject}
|
||||
canReport={this.props.canReport}
|
||||
canRestoreComments={this.props.isAdmin}
|
||||
comments={this.props.comments}
|
||||
|
|
Loading…
Reference in a new issue