You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
539 B
JavaScript
28 lines
539 B
JavaScript
"use strict";
|
|
|
|
const React = require("react");
|
|
const create = require("create-react-class");
|
|
|
|
const generateJdenticon = require("../../lib/generate-jdenticon");
|
|
|
|
let User = create({
|
|
displayName: "user",
|
|
|
|
getInitialState: function() {
|
|
return {
|
|
/* FIXME: Cache this to speed it up */
|
|
color: generateJdenticon(this.props.user.userId).primaryColor()
|
|
};
|
|
},
|
|
|
|
render: function() {
|
|
return (
|
|
<div className="user" style={{color: this.state.color}}>
|
|
{this.props.user.displayName}
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
module.exports = User;
|