diff options
Diffstat (limited to 'vnext/src/components/UserInfo.js')
-rw-r--r-- | vnext/src/components/UserInfo.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/vnext/src/components/UserInfo.js b/vnext/src/components/UserInfo.js index c4247f92..5e60f95f 100644 --- a/vnext/src/components/UserInfo.js +++ b/vnext/src/components/UserInfo.js @@ -22,8 +22,9 @@ export default class UserInfo extends React.Component { componentDidMount() { info(this.state.user.uname).then(response => { this.setState({ - user: response.data[0] + user: response.data }); + this.props.onUpdate && this.props.onUpdate(response.data); }); } render() { @@ -70,23 +71,17 @@ export default class UserInfo extends React.Component { <li>Messages: {user.statsMessages}</li> <li>Comments: {user.statsReplies}</li> </ul> - { - user.read && - <div className="iread"> - { - user.read.map(u => <Avatar user={u} key={u.uid} />) - } - </div> - } </div> </> } </div> + { this.props.children } </> ); } } UserInfo.propTypes = { - user: PropTypes.string.isRequired + user: PropTypes.string.isRequired, + onUpdate: PropTypes.func }; |