2017-02-17 00:46:39 +00:00
|
|
|
import React, { PureComponent } from 'react';
|
2018-10-07 23:34:53 +00:00
|
|
|
import stringToRGB from 'utils/color';
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2017-02-17 00:46:39 +00:00
|
|
|
export default class UserListItem extends PureComponent {
|
2017-05-27 05:30:22 +00:00
|
|
|
handleClick = () => this.props.onClick(this.props.user.nick);
|
2015-12-28 23:34:32 +00:00
|
|
|
|
|
|
|
render() {
|
2018-10-06 23:27:26 +00:00
|
|
|
const { user } = this.props;
|
2018-10-06 22:25:56 +00:00
|
|
|
const style = {
|
2018-10-07 23:34:53 +00:00
|
|
|
color: stringToRGB(user.nick),
|
2018-10-06 22:25:56 +00:00
|
|
|
...this.props.style
|
|
|
|
};
|
|
|
|
|
2017-03-23 19:38:27 +00:00
|
|
|
return (
|
2018-10-06 22:25:56 +00:00
|
|
|
<p style={style} onClick={this.handleClick}>
|
|
|
|
{user.renderName}
|
2017-03-23 19:38:27 +00:00
|
|
|
</p>
|
|
|
|
);
|
2015-12-28 23:34:32 +00:00
|
|
|
}
|
|
|
|
}
|