2018-11-04 06:22:46 +00:00
|
|
|
import React, { memo } from 'react';
|
2018-10-07 23:34:53 +00:00
|
|
|
import stringToRGB from 'utils/color';
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
const UserListItem = ({ user, coloredNick, style, onClick }) => {
|
|
|
|
if (coloredNick) {
|
|
|
|
style = {
|
|
|
|
...style,
|
|
|
|
color: stringToRGB(user.nick)
|
|
|
|
};
|
|
|
|
}
|
2018-10-15 06:56:17 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
return (
|
|
|
|
<p style={style} onClick={() => onClick(user.nick)}>
|
|
|
|
{user.renderName}
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
};
|
2018-10-06 22:25:56 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
export default memo(UserListItem);
|