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