diff options
author | Vitaly Takmazov | 2018-12-12 15:47:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:54 +0300 |
commit | e7b32a80cdcf0fa9ca97c14cda33db6d81b451d6 (patch) | |
tree | 3d0e53fcf47757bb02e2b44a94679b4f74b3a867 /vnext/src/components/UserInfo.js | |
parent | 0c31e9ae31403beb3c390e864f0aae653240868d (diff) |
read/readers
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 }; |