mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 03:21:58 +08:00
Adding author id to posted comments.
This commit is contained in:
@@ -105,7 +105,7 @@ class CommentStream extends Component {
|
||||
id={rootItemId}
|
||||
premod={this.props.config.moderation}
|
||||
reply={false}
|
||||
canPost={loggedIn}
|
||||
authorId={user.id}
|
||||
/>
|
||||
{!loggedIn && <SignInContainer />}
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,8 @@ class CommentBox extends Component {
|
||||
id: PropTypes.string,
|
||||
comments: PropTypes.array,
|
||||
reply: PropTypes.bool,
|
||||
canPost: PropTypes.bool
|
||||
canPost: PropTypes.bool,
|
||||
currentUser: PropTypes.object
|
||||
}
|
||||
|
||||
state = {
|
||||
@@ -21,11 +22,11 @@ class CommentBox extends Component {
|
||||
}
|
||||
|
||||
postComment = () => {
|
||||
const {postItem, updateItem, id, parent_id, addNotification, appendItemArray, premod} = this.props;
|
||||
const {postItem, updateItem, id, parent_id, addNotification, appendItemArray, premod, authorId} = this.props;
|
||||
let comment = {
|
||||
body: this.state.body,
|
||||
asset_id: id,
|
||||
username: this.state.username
|
||||
user_id: authorId.id
|
||||
};
|
||||
let related;
|
||||
let parent_type;
|
||||
@@ -52,7 +53,7 @@ class CommentBox extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const {styles, reply, canPost} = this.props;
|
||||
const {styles, reply, authorId} = this.props;
|
||||
// How to handle language in plugins? Should we have a dependency on our central translation file?
|
||||
return <div>
|
||||
<div
|
||||
@@ -73,7 +74,7 @@ class CommentBox extends Component {
|
||||
rows={3}/>
|
||||
</div>
|
||||
<div className={`${name}-button-container`}>
|
||||
{ canPost && (
|
||||
{ authorId && (
|
||||
<button
|
||||
className={`${name}-button`}
|
||||
style={styles && styles.button}
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ definitions:
|
||||
description: Display name of comment
|
||||
user_id:
|
||||
type: string
|
||||
description: Display name of comment
|
||||
description: User who posted the comment
|
||||
parent_id:
|
||||
type: string
|
||||
description: Display name of comment
|
||||
|
||||
Reference in New Issue
Block a user