|
@ -86,7 +86,7 @@ class NewPost extends Component { |
|
|
previewDate, postSubjectInputEmptySubmit, postSubjectInput, postContentInputEmptySubmit, |
|
|
previewDate, postSubjectInputEmptySubmit, postSubjectInput, postContentInputEmptySubmit, |
|
|
postContentInput, previewEnabled |
|
|
postContentInput, previewEnabled |
|
|
} = this.state; |
|
|
} = this.state; |
|
|
const { postIndex, avatarUrl, user, onCancelClick } = this.props; |
|
|
const { postIndex, avatarUrl, username, onCancelClick } = this.props; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<div className="post" ref={this.newPostOuterRef}> |
|
|
<div className="post" ref={this.newPostOuterRef}> |
|
@ -103,13 +103,13 @@ class NewPost extends Component { |
|
|
size="52" |
|
|
size="52" |
|
|
className="inline user-avatar" |
|
|
className="inline user-avatar" |
|
|
src={avatarUrl} |
|
|
src={avatarUrl} |
|
|
name={user.username} |
|
|
name={username} |
|
|
/> |
|
|
/> |
|
|
</Grid.Column> |
|
|
</Grid.Column> |
|
|
<Grid.Column width={15}> |
|
|
<Grid.Column width={15}> |
|
|
<div className=""> |
|
|
<div className=""> |
|
|
<div className="stretch-space-between"> |
|
|
<div className="stretch-space-between"> |
|
|
<span><strong>{user.username}</strong></span> |
|
|
<span><strong>{username}</strong></span> |
|
|
<span className="grey-text"> |
|
|
<span className="grey-text"> |
|
|
{previewEnabled |
|
|
{previewEnabled |
|
|
&& <TimeAgo date={previewDate} /> |
|
|
&& <TimeAgo date={previewDate} /> |
|
@ -218,15 +218,14 @@ NewPost.propTypes = { |
|
|
topicID: PropTypes.number.isRequired, |
|
|
topicID: PropTypes.number.isRequired, |
|
|
postIndex: PropTypes.number.isRequired, |
|
|
postIndex: PropTypes.number.isRequired, |
|
|
avatarUrl: PropTypes.string, |
|
|
avatarUrl: PropTypes.string, |
|
|
user: PropTypes.object.isRequired, |
|
|
username: PropTypes.string.isRequired, |
|
|
onCancelClick: PropTypes.func.isRequired, |
|
|
onCancelClick: PropTypes.func.isRequired, |
|
|
dispatch: PropTypes.func.isRequired, |
|
|
dispatch: PropTypes.func.isRequired, |
|
|
onPostCreated: PropTypes.func.isRequired |
|
|
onPostCreated: PropTypes.func.isRequired |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({ |
|
|
const mapStateToProps = state => ({ |
|
|
orbitDB: state.orbitDB, |
|
|
username: state.user.username |
|
|
user: state.user |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(NewPost); |
|
|
export default connect(mapStateToProps)(NewPost); |